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

Percentage Accurate: 90.2% → 97.2%
Time: 8.5s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
(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]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)

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 14 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.2% accurate, 1.0× speedup?

\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
(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]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)

Alternative 1: 97.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(a \cdot \left(c \cdot \left(i \cdot \left(1 + \frac{b \cdot c}{\color{blue}{a}}\right)\right)\right)\right) \]
      7. lower-*.f6445.9%

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

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

    if -4.9999999999999999e294 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.0000000000000001e204

    1. Initial program 90.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e204 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 90.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, \left(\mathsf{neg}\left(\color{blue}{c \cdot \left(\left(1 + \frac{b \cdot c}{a}\right) \cdot a\right)}\right)\right) \cdot i\right)\right) \]
      11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.0% accurate, 1.0× speedup?

\[2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, \left(\left(-c\right) \cdot i\right) \cdot \mathsf{fma}\left(c, b, a\right)\right)\right) \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (fma y x (fma z t (* (* (- c) i) (fma c b a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * fma(y, x, fma(z, t, ((-c * i) * fma(c, b, a))));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * fma(y, x, fma(z, t, Float64(Float64(Float64(-c) * i) * fma(c, b, a)))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(y * x + N[(z * t + N[(N[((-c) * i), $MachinePrecision] * N[(c * b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, \left(\left(-c\right) \cdot i\right) \cdot \mathsf{fma}\left(c, b, a\right)\right)\right)
Derivation
  1. Initial program 90.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. Step-by-step derivation
    1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, \left(\mathsf{neg}\left(\color{blue}{c \cdot \left(\left(1 + \frac{b \cdot c}{a}\right) \cdot a\right)}\right)\right) \cdot i\right)\right) \]
    11. distribute-lft-neg-inN/A

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

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

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

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

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

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

Alternative 3: 95.0% accurate, 0.5× speedup?

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

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

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


\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 90.2%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + \color{blue}{b \cdot c}\right)\right)\right) \]
      6. lower-*.f6469.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000002e287

    1. Initial program 90.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e287 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

Alternative 4: 89.3% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + \color{blue}{b \cdot c}\right)\right)\right) \]
      6. lower-*.f6469.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e236 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e121

    1. Initial program 90.2%

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(a \cdot c\right)} \cdot i\right) \]
    3. Step-by-step derivation
      1. lower-*.f6471.6%

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

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

Alternative 5: 89.0% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + \color{blue}{b \cdot c}\right)\right)\right) \]
      6. lower-*.f6469.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e236 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e121

    1. Initial program 90.2%

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

      \[\leadsto 2 \cdot \color{blue}{\left(\left(t \cdot z + x \cdot y\right) - a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. 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. lower-*.f64N/A

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

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

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

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

Alternative 6: 85.3% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + \color{blue}{b \cdot c}\right)\right)\right) \]
      6. lower-*.f6469.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e164 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.9999999999999999e90

    1. Initial program 90.2%

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

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

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

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

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

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

Alternative 7: 81.8% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

    if -1e164 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e195

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(t \cdot z + y \cdot x\right) \cdot 2 \]
      8. lift-*.f64N/A

        \[\leadsto \left(t \cdot z + y \cdot x\right) \cdot 2 \]
      9. lift-*.f64N/A

        \[\leadsto \left(t \cdot z + y \cdot x\right) \cdot 2 \]
      10. *-commutativeN/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot 2 \]
      11. lift-*.f64N/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot 2 \]
      12. +-commutativeN/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      13. lift-*.f64N/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      14. lower-fma.f6455.8%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, z \cdot t\right) \cdot 2 \]
      17. lower-*.f6455.8%

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

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

Alternative 8: 66.5% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + \color{blue}{b \cdot c}\right)\right)\right) \]
      6. lower-*.f6469.0%

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - a \cdot \left(c \cdot \color{blue}{i}\right)\right) \]
      2. lower-*.f6449.9%

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

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

    if -1e164 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.9999999999999998e93

    1. Initial program 90.2%

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

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

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

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

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

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

    if 2.9999999999999998e93 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + \color{blue}{b \cdot c}\right)\right)\right) \]
      6. lower-*.f6469.0%

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - a \cdot \left(c \cdot \color{blue}{i}\right)\right) \]
      2. lower-*.f6449.9%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - \left(a \cdot c\right) \cdot i\right) \]
      5. lower-*.f6447.8%

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

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

Alternative 9: 65.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + \color{blue}{b \cdot c}\right)\right)\right) \]
      6. lower-*.f6469.0%

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - a \cdot \left(c \cdot \color{blue}{i}\right)\right) \]
      2. lower-*.f6449.9%

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

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

    if -1e164 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.9999999999999998e93

    1. Initial program 90.2%

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

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

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

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

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

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

Alternative 10: 63.5% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

        \[\leadsto -2 \cdot \left(a \cdot \color{blue}{\left(c \cdot i\right)}\right) \]
      3. lower-*.f6425.1%

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

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

    if -2.0000000000000001e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e287

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(t \cdot z + y \cdot x\right) \cdot 2 \]
      8. lift-*.f64N/A

        \[\leadsto \left(t \cdot z + y \cdot x\right) \cdot 2 \]
      9. lift-*.f64N/A

        \[\leadsto \left(t \cdot z + y \cdot x\right) \cdot 2 \]
      10. *-commutativeN/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot 2 \]
      11. lift-*.f64N/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot 2 \]
      12. +-commutativeN/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      13. lift-*.f64N/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      14. lower-fma.f6455.8%

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

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

        \[\leadsto \mathsf{fma}\left(x, y, z \cdot t\right) \cdot 2 \]
      17. lower-*.f6455.8%

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

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

Alternative 11: 63.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 90.2%

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

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

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

        \[\leadsto -2 \cdot \left(a \cdot \color{blue}{\left(c \cdot i\right)}\right) \]
      3. lower-*.f6425.1%

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

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

    if -2.0000000000000001e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e287

    1. Initial program 90.2%

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

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

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

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

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

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

Alternative 12: 45.1% accurate, 0.7× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (fmax(z, t) + fmax(z, t)) * fmin(z, t)
    if (fmin(z, t) <= (-3.6d+74)) then
        tmp = t_1
    else if (fmin(z, t) <= (-0.16d0)) then
        tmp = (-2.0d0) * (a * (c * i))
    else if (fmin(z, t) <= 2.1d-146) then
        tmp = (x + x) * y
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (fmax(z, t) + fmax(z, t)) * fmin(z, t);
	double tmp;
	if (fmin(z, t) <= -3.6e+74) {
		tmp = t_1;
	} else if (fmin(z, t) <= -0.16) {
		tmp = -2.0 * (a * (c * i));
	} else if (fmin(z, t) <= 2.1e-146) {
		tmp = (x + x) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (fmax(z, t) + fmax(z, t)) * fmin(z, t)
	tmp = 0
	if fmin(z, t) <= -3.6e+74:
		tmp = t_1
	elif fmin(z, t) <= -0.16:
		tmp = -2.0 * (a * (c * i))
	elif fmin(z, t) <= 2.1e-146:
		tmp = (x + x) * y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(fmax(z, t) + fmax(z, t)) * fmin(z, t))
	tmp = 0.0
	if (fmin(z, t) <= -3.6e+74)
		tmp = t_1;
	elseif (fmin(z, t) <= -0.16)
		tmp = Float64(-2.0 * Float64(a * Float64(c * i)));
	elseif (fmin(z, t) <= 2.1e-146)
		tmp = Float64(Float64(x + x) * y);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (max(z, t) + max(z, t)) * min(z, t);
	tmp = 0.0;
	if (min(z, t) <= -3.6e+74)
		tmp = t_1;
	elseif (min(z, t) <= -0.16)
		tmp = -2.0 * (a * (c * i));
	elseif (min(z, t) <= 2.1e-146)
		tmp = (x + x) * y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[Max[z, t], $MachinePrecision] + N[Max[z, t], $MachinePrecision]), $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[z, t], $MachinePrecision], -3.6e+74], t$95$1, If[LessEqual[N[Min[z, t], $MachinePrecision], -0.16], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[z, t], $MachinePrecision], 2.1e-146], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(\mathsf{max}\left(z, t\right) + \mathsf{max}\left(z, t\right)\right) \cdot \mathsf{min}\left(z, t\right)\\
\mathbf{if}\;\mathsf{min}\left(z, t\right) \leq -3.6 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\mathsf{min}\left(z, t\right) \leq -0.16:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\

\mathbf{elif}\;\mathsf{min}\left(z, t\right) \leq 2.1 \cdot 10^{-146}:\\
\;\;\;\;\left(x + x\right) \cdot y\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.5999999999999999e74 or 2.0999999999999999e-146 < z

    1. Initial program 90.2%

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
      2. lower-*.f6429.6%

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

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

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

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

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

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

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

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

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

    if -3.5999999999999999e74 < z < -0.16

    1. Initial program 90.2%

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

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

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

        \[\leadsto -2 \cdot \left(a \cdot \color{blue}{\left(c \cdot i\right)}\right) \]
      3. lower-*.f6425.1%

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

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

    if -0.16 < z < 2.0999999999999999e-146

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + x\right) \cdot y \]
      6. lower-+.f6429.5%

        \[\leadsto \left(x + x\right) \cdot y \]
    6. Applied rewrites29.5%

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

Alternative 13: 40.7% accurate, 1.3× speedup?

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

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

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

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

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


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

    1. Initial program 90.2%

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
      2. lower-*.f6429.6%

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

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

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

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

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

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

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

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

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

    if -5.0000000000000001e54 < (*.f64 z t) < 9.9999999999999993e74

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + x\right) \cdot y \]
      6. lower-+.f6429.5%

        \[\leadsto \left(x + x\right) \cdot y \]
    6. Applied rewrites29.5%

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

Alternative 14: 29.6% accurate, 4.0× speedup?

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
    2. lower-*.f6429.6%

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

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

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

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

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

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

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

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

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

Reproduce

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