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

Percentage Accurate: 90.0% → 95.0%
Time: 4.8s
Alternatives: 15
Speedup: 0.5×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 90.0% 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.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+248} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+275}\right):\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(\mathsf{fma}\left(b, c, a\right) \cdot \left(-i\right)\right) \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_1\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 (or (<= t_1 -1e+248) (not (<= t_1 2e+275)))
     (* 2.0 (fma z t (* (* (fma b c a) (- i)) c)))
     (* 2.0 (- (+ (* x y) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if ((t_1 <= -1e+248) || !(t_1 <= 2e+275)) {
		tmp = 2.0 * fma(z, t, ((fma(b, c, a) * -i) * c));
	} else {
		tmp = 2.0 * (((x * y) + (z * t)) - t_1);
	}
	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+248) || !(t_1 <= 2e+275))
		tmp = Float64(2.0 * fma(z, t, Float64(Float64(fma(b, c, a) * Float64(-i)) * c)));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_1));
	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[Or[LessEqual[t$95$1, -1e+248], N[Not[LessEqual[t$95$1, 2e+275]], $MachinePrecision]], N[(2.0 * N[(z * t + N[(N[(N[(b * c + a), $MachinePrecision] * (-i)), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $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^{+248} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+275}\right):\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(\mathsf{fma}\left(b, c, a\right) \cdot \left(-i\right)\right) \cdot c\right)\\

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


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

    1. Initial program 80.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6491.8

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c}\right) \]
      2. lift-*.f64N/A

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
      5. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      6. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \left(-\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      13. lower-fma.f6493.6

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

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

    if -1.00000000000000005e248 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999992e275

    1. Initial program 99.2%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification96.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -1 \cdot 10^{+248} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 2 \cdot 10^{+275}\right):\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(\mathsf{fma}\left(b, c, a\right) \cdot \left(-i\right)\right) \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;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} \]
  5. Add Preprocessing

Alternative 2: 84.6% 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 -\infty:\\ \;\;\;\;2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-39} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+80}\right):\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\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 (- INFINITY))
     (* 2.0 (- (* t z) (* (* (fma c b a) i) c)))
     (if (or (<= t_1 -2e-39) (not (<= t_1 2e+80)))
       (* 2.0 (- (* y x) (* (* (fma b c a) c) i)))
       (* 2.0 (fma t z (* y x)))))))
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 <= -((double) INFINITY)) {
		tmp = 2.0 * ((t * z) - ((fma(c, b, a) * i) * c));
	} else if ((t_1 <= -2e-39) || !(t_1 <= 2e+80)) {
		tmp = 2.0 * ((y * x) - ((fma(b, c, a) * c) * i));
	} else {
		tmp = 2.0 * fma(t, z, (y * x));
	}
	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 <= Float64(-Inf))
		tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * i) * c)));
	elseif ((t_1 <= -2e-39) || !(t_1 <= 2e+80))
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(b, c, a) * c) * i)));
	else
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	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, (-Infinity)], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -2e-39], N[Not[LessEqual[t$95$1, 2e+80]], $MachinePrecision]], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $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 -\infty:\\
\;\;\;\;2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\

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

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


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

    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. Add Preprocessing
    3. 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)} \]
    4. 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.f6493.4

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999986e-39 or 2e80 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 89.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
      16. 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) \]
      17. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \]
    7. Applied rewrites84.9%

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

    if -1.99999999999999986e-39 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e80

    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. Add Preprocessing
    3. Taylor expanded in c around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. 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-*.f6491.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -\infty:\\ \;\;\;\;2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{elif}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -2 \cdot 10^{-39} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 2 \cdot 10^{+80}\right):\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.6% accurate, 0.4× 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 -5 \cdot 10^{+239}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-10}:\\ \;\;\;\;2 \cdot \left(y \cdot x - a \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+263}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\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 -5e+239)
     (* 2.0 (- (* t z) t_1))
     (if (<= t_2 -5e-10)
       (* 2.0 (- (* y x) (* a (* i c))))
       (if (<= t_2 2e+263) (* 2.0 (fma t z (* y x))) (* -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 <= -5e+239) {
		tmp = 2.0 * ((t * z) - t_1);
	} else if (t_2 <= -5e-10) {
		tmp = 2.0 * ((y * x) - (a * (i * c)));
	} else if (t_2 <= 2e+263) {
		tmp = 2.0 * fma(t, z, (y * x));
	} 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 <= -5e+239)
		tmp = Float64(2.0 * Float64(Float64(t * z) - t_1));
	elseif (t_2 <= -5e-10)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(a * Float64(i * c))));
	elseif (t_2 <= 2e+263)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	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, -5e+239], N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-10], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(a * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+263], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $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 -5 \cdot 10^{+239}:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\

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

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

\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_1\\


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

    1. Initial program 78.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6492.0

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

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

    if -5.00000000000000007e239 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000031e-10

    1. Initial program 99.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \left(y \cdot x - \color{blue}{a} \cdot \left(i \cdot c\right)\right) \]
    9. Step-by-step derivation
      1. *-commutative76.1

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

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

    if -5.00000000000000031e-10 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 99.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. 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-*.f6485.6

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

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

    if 2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 82.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6490.8

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

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

Alternative 4: 80.6% accurate, 0.4× 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 -5 \cdot 10^{+294}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-10}:\\ \;\;\;\;2 \cdot \left(y \cdot x - a \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+263}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* (* (fma c b a) i) c))) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -5e+294)
     t_1
     (if (<= t_2 -5e-10)
       (* 2.0 (- (* y x) (* a (* i c))))
       (if (<= t_2 2e+263) (* 2.0 (fma t z (* y x))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -2.0 * ((fma(c, b, a) * i) * c);
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -5e+294) {
		tmp = t_1;
	} else if (t_2 <= -5e-10) {
		tmp = 2.0 * ((y * x) - (a * (i * c)));
	} else if (t_2 <= 2e+263) {
		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 <= -5e+294)
		tmp = t_1;
	elseif (t_2 <= -5e-10)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(a * Float64(i * c))));
	elseif (t_2 <= 2e+263)
		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, -5e+294], t$95$1, If[LessEqual[t$95$2, -5e-10], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(a * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+263], 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 -5 \cdot 10^{+294}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 81.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6490.0

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

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

    if -4.9999999999999999e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000031e-10

    1. Initial program 96.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \left(y \cdot x - \color{blue}{a} \cdot \left(i \cdot c\right)\right) \]
    9. Step-by-step derivation
      1. *-commutative73.1

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

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

    if -5.00000000000000031e-10 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 99.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. 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-*.f6485.6

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

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

Alternative 5: 95.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 95.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6441.7

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, -a \cdot \left(i \cdot c\right)\right) \]
      6. lift-*.f64N/A

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(t, \color{blue}{z}, -\left(i \cdot c\right) \cdot a\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \leq \infty:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, \left(i \cdot c\right) \cdot \left(-a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 89.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+294} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(\mathsf{fma}\left(b, c, a\right) \cdot \left(-i\right)\right) \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\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 (or (<= t_1 -5e+294) (not (<= t_1 2e+263)))
     (* 2.0 (fma z t (* (* (fma b c a) (- i)) c)))
     (* 2.0 (- (fma t z (* y x)) (* (* i c) 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 <= -5e+294) || !(t_1 <= 2e+263)) {
		tmp = 2.0 * fma(z, t, ((fma(b, c, a) * -i) * c));
	} else {
		tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * 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 <= -5e+294) || !(t_1 <= 2e+263))
		tmp = Float64(2.0 * fma(z, t, Float64(Float64(fma(b, c, a) * Float64(-i)) * c)));
	else
		tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * 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[Or[LessEqual[t$95$1, -5e+294], N[Not[LessEqual[t$95$1, 2e+263]], $MachinePrecision]], N[(2.0 * N[(z * t + N[(N[(N[(b * c + a), $MachinePrecision] * (-i)), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $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 -5 \cdot 10^{+294} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+263}\right):\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(\mathsf{fma}\left(b, c, a\right) \cdot \left(-i\right)\right) \cdot c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999999e294 or 2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6491.8

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c}\right) \]
      2. lift-*.f64N/A

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
      5. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      6. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \left(-\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      13. lower-fma.f6493.7

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

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

    if -4.9999999999999999e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -5 \cdot 10^{+294} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(\mathsf{fma}\left(b, c, a\right) \cdot \left(-i\right)\right) \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\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) < -4.9999999999999999e294

    1. Initial program 78.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6493.5

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

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

    if -4.9999999999999999e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 82.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6490.8

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

      \[\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 8: 80.7% 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^{+239} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\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 (or (<= t_1 -5e+239) (not (<= t_1 2e+263)))
     (* -2.0 (* (* (fma c b a) i) c))
     (* 2.0 (fma t z (* y x))))))
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+239) || !(t_1 <= 2e+263)) {
		tmp = -2.0 * ((fma(c, b, a) * i) * c);
	} else {
		tmp = 2.0 * fma(t, z, (y * x));
	}
	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+239) || !(t_1 <= 2e+263))
		tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c));
	else
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	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[Or[LessEqual[t$95$1, -5e+239], N[Not[LessEqual[t$95$1, 2e+263]], $MachinePrecision]], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000007e239 or 2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 80.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. Add Preprocessing
    3. 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)} \]
    4. 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.f6488.6

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

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

    if -5.00000000000000007e239 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 99.2%

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. 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-*.f6479.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -5 \cdot 10^{+239} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 73.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^{+294} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;\left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\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 (or (<= t_1 -5e+294) (not (<= t_1 2e+263)))
     (* (* c (* c (* i b))) -2.0)
     (* 2.0 (fma t z (* y x))))))
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+294) || !(t_1 <= 2e+263)) {
		tmp = (c * (c * (i * b))) * -2.0;
	} else {
		tmp = 2.0 * fma(t, z, (y * x));
	}
	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+294) || !(t_1 <= 2e+263))
		tmp = Float64(Float64(c * Float64(c * Float64(i * b))) * -2.0);
	else
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	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[Or[LessEqual[t$95$1, -5e+294], N[Not[LessEqual[t$95$1, 2e+263]], $MachinePrecision]], N[(N[(c * N[(c * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999999e294 or 2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. 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-*.f6465.8

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

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    6. 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-*.f6466.5

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in c around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. 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-*.f6478.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -5 \cdot 10^{+294} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;\left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

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

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

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

    1. Initial program 78.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. 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-*.f6463.9

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

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    6. 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-*.f6465.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in c around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. 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-*.f6478.3

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

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

    if 2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 82.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. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. 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-*.f6467.2

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

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    6. 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-*.f6470.1

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 62.7% 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^{+294} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\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 (or (<= t_1 -5e+294) (not (<= t_1 2e+263)))
     (* (* (* i c) a) -2.0)
     (* 2.0 (fma t z (* y x))))))
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+294) || !(t_1 <= 2e+263)) {
		tmp = ((i * c) * a) * -2.0;
	} else {
		tmp = 2.0 * fma(t, z, (y * x));
	}
	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+294) || !(t_1 <= 2e+263))
		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
	else
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	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[Or[LessEqual[t$95$1, -5e+294], N[Not[LessEqual[t$95$1, 2e+263]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999999e294 or 2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    4. 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-*.f6447.8

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

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

    if -4.9999999999999999e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e263

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in c around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. 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-*.f6478.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -5 \cdot 10^{+294} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 40.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -10000000000000 \lor \neg \left(t\_1 \leq 10^{+264}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\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 (or (<= t_1 -10000000000000.0) (not (<= t_1 1e+264)))
     (* (* (* i c) a) -2.0)
     (* 2.0 (* y x)))))
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 <= -10000000000000.0) || !(t_1 <= 1e+264)) {
		tmp = ((i * c) * a) * -2.0;
	} else {
		tmp = 2.0 * (y * x);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((a + (b * c)) * c) * i
    if ((t_1 <= (-10000000000000.0d0)) .or. (.not. (t_1 <= 1d+264))) then
        tmp = ((i * c) * a) * (-2.0d0)
    else
        tmp = 2.0d0 * (y * x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if ((t_1 <= -10000000000000.0) || !(t_1 <= 1e+264)) {
		tmp = ((i * c) * a) * -2.0;
	} else {
		tmp = 2.0 * (y * x);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((a + (b * c)) * c) * i
	tmp = 0
	if (t_1 <= -10000000000000.0) or not (t_1 <= 1e+264):
		tmp = ((i * c) * a) * -2.0
	else:
		tmp = 2.0 * (y * x)
	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 <= -10000000000000.0) || !(t_1 <= 1e+264))
		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
	else
		tmp = Float64(2.0 * Float64(y * x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = ((a + (b * c)) * c) * i;
	tmp = 0.0;
	if ((t_1 <= -10000000000000.0) || ~((t_1 <= 1e+264)))
		tmp = ((i * c) * a) * -2.0;
	else
		tmp = 2.0 * (y * x);
	end
	tmp_2 = 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[Or[LessEqual[t$95$1, -10000000000000.0], N[Not[LessEqual[t$95$1, 1e+264]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(y * x), $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 -10000000000000 \lor \neg \left(t\_1 \leq 10^{+264}\right):\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\


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

    1. Initial program 84.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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    4. 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-*.f6446.5

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

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

    if -1e13 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000004e264

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
    5. Applied rewrites52.9%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -10000000000000 \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 10^{+264}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 39.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 -10000000000000 \lor \neg \left(t\_1 \leq 10^{+264}\right):\\ \;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\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 (or (<= t_1 -10000000000000.0) (not (<= t_1 1e+264)))
     (* (* (* a c) i) -2.0)
     (* 2.0 (* y x)))))
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 <= -10000000000000.0) || !(t_1 <= 1e+264)) {
		tmp = ((a * c) * i) * -2.0;
	} else {
		tmp = 2.0 * (y * x);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((a + (b * c)) * c) * i
    if ((t_1 <= (-10000000000000.0d0)) .or. (.not. (t_1 <= 1d+264))) then
        tmp = ((a * c) * i) * (-2.0d0)
    else
        tmp = 2.0d0 * (y * x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if ((t_1 <= -10000000000000.0) || !(t_1 <= 1e+264)) {
		tmp = ((a * c) * i) * -2.0;
	} else {
		tmp = 2.0 * (y * x);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((a + (b * c)) * c) * i
	tmp = 0
	if (t_1 <= -10000000000000.0) or not (t_1 <= 1e+264):
		tmp = ((a * c) * i) * -2.0
	else:
		tmp = 2.0 * (y * x)
	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 <= -10000000000000.0) || !(t_1 <= 1e+264))
		tmp = Float64(Float64(Float64(a * c) * i) * -2.0);
	else
		tmp = Float64(2.0 * Float64(y * x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = ((a + (b * c)) * c) * i;
	tmp = 0.0;
	if ((t_1 <= -10000000000000.0) || ~((t_1 <= 1e+264)))
		tmp = ((a * c) * i) * -2.0;
	else
		tmp = 2.0 * (y * x);
	end
	tmp_2 = 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[Or[LessEqual[t$95$1, -10000000000000.0], N[Not[LessEqual[t$95$1, 1e+264]], $MachinePrecision]], N[(N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(y * x), $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 -10000000000000 \lor \neg \left(t\_1 \leq 10^{+264}\right):\\
\;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\


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

    1. Initial program 84.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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    4. 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-*.f6446.5

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

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]
    6. 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-*.f6444.8

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

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

    if -1e13 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000004e264

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
    5. Applied rewrites52.9%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq -10000000000000 \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq 10^{+264}\right):\\ \;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 43.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+94} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+130}\right):\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* z t) -5e+94) (not (<= (* z t) 5e+130)))
   (* 2.0 (* t z))
   (* 2.0 (* y x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((z * t) <= -5e+94) || !((z * t) <= 5e+130)) {
		tmp = 2.0 * (t * z);
	} else {
		tmp = 2.0 * (y * x);
	}
	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) :: tmp
    if (((z * t) <= (-5d+94)) .or. (.not. ((z * t) <= 5d+130))) then
        tmp = 2.0d0 * (t * z)
    else
        tmp = 2.0d0 * (y * x)
    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 tmp;
	if (((z * t) <= -5e+94) || !((z * t) <= 5e+130)) {
		tmp = 2.0 * (t * z);
	} else {
		tmp = 2.0 * (y * x);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((z * t) <= -5e+94) or not ((z * t) <= 5e+130):
		tmp = 2.0 * (t * z)
	else:
		tmp = 2.0 * (y * x)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(z * t) <= -5e+94) || !(Float64(z * t) <= 5e+130))
		tmp = Float64(2.0 * Float64(t * z));
	else
		tmp = Float64(2.0 * Float64(y * x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((z * t) <= -5e+94) || ~(((z * t) <= 5e+130)))
		tmp = 2.0 * (t * z);
	else
		tmp = 2.0 * (y * x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e+94], N[Not[LessEqual[N[(z * t), $MachinePrecision], 5e+130]], $MachinePrecision]], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+94} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+130}\right):\\
\;\;\;\;2 \cdot \left(t \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -5.0000000000000001e94 or 4.9999999999999996e130 < (*.f64 z t)

    1. Initial program 84.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. Add Preprocessing
    3. Taylor expanded in z around inf

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

        \[\leadsto 2 \cdot \left(t \cdot \color{blue}{z}\right) \]
    5. Applied rewrites59.3%

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

    if -5.0000000000000001e94 < (*.f64 z t) < 4.9999999999999996e130

    1. Initial program 93.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. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

        \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
    5. Applied rewrites40.8%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+94} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+130}\right):\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 28.8% accurate, 3.6× speedup?

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

\\
2 \cdot \left(t \cdot z\right)
\end{array}
Derivation
  1. Initial program 91.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. Add Preprocessing
  3. Taylor expanded in z around inf

    \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
  4. Step-by-step derivation
    1. lower-*.f6422.4

      \[\leadsto 2 \cdot \left(t \cdot \color{blue}{z}\right) \]
  5. Applied rewrites22.4%

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

Developer Target 1: 94.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\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(a + Float64(b * c)) * Float64(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[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Reproduce

?
herbie shell --seed 2025057 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :alt
  (! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))

  (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))