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

Percentage Accurate: 90.1% → 95.7%
Time: 8.3s
Alternatives: 16
Speedup: 0.7×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 90.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 95.7% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 75.5%

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

        \[\leadsto \color{blue}{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. *-commutativeN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, \color{blue}{t \cdot z}\right) \cdot 2 \]
    6. Step-by-step derivation
      1. Applied rewrites95.3%

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

      if -1.0000000000000001e287 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000001e276

      1. Initial program 99.9%

        \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. Add Preprocessing
      3. 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. +-commutativeN/A

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

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

          \[\leadsto 2 \cdot \left(\color{blue}{z \cdot t} + \left(x \cdot y - \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(z, t, x \cdot y - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
        7. lower--.f6499.9

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

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

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

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

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

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

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

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

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

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

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

      if 5.00000000000000001e276 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 75.1%

        \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. Add Preprocessing
      3. 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(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
        3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 84.2% accurate, 0.4× speedup?

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

      1. Initial program 80.0%

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

          \[\leadsto \color{blue}{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. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, \color{blue}{t \cdot z}\right) \cdot 2 \]
      6. Step-by-step derivation
        1. Applied rewrites90.8%

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

        if -1.99999999999999991e171 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000004e55

        1. Initial program 100.0%

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

          \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
        4. Step-by-step derivation
          1. Applied rewrites92.7%

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

          if 4.00000000000000004e55 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999995e211

          1. Initial program 99.8%

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

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

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

          if 4.9999999999999995e211 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

          1. Initial program 78.9%

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

            \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites93.8%

              \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
            2. Step-by-step derivation
              1. Applied rewrites96.8%

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

            Alternative 3: 83.7% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+164}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+55}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+211}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(i \cdot c\right)\\ \end{array} \end{array} \]
            (FPCore (x y z t a b c i)
             :precision binary64
             (let* ((t_1 (* 2.0 (fma (- i) (* (fma c b a) c) (* t z))))
                    (t_2 (* (* (+ a (* b c)) c) i)))
               (if (<= t_2 -4e+164)
                 t_1
                 (if (<= t_2 4e+55)
                   (* 2.0 (fma t z (* y x)))
                   (if (<= t_2 5e+211) t_1 (* (* -2.0 (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 = 2.0 * fma(-i, (fma(c, b, a) * c), (t * z));
            	double t_2 = ((a + (b * c)) * c) * i;
            	double tmp;
            	if (t_2 <= -4e+164) {
            		tmp = t_1;
            	} else if (t_2 <= 4e+55) {
            		tmp = 2.0 * fma(t, z, (y * x));
            	} else if (t_2 <= 5e+211) {
            		tmp = t_1;
            	} else {
            		tmp = (-2.0 * fma(b, c, a)) * (i * c);
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b, c, i)
            	t_1 = Float64(2.0 * fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(t * z)))
            	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
            	tmp = 0.0
            	if (t_2 <= -4e+164)
            		tmp = t_1;
            	elseif (t_2 <= 4e+55)
            		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
            	elseif (t_2 <= 5e+211)
            		tmp = t_1;
            	else
            		tmp = Float64(Float64(-2.0 * fma(b, c, a)) * Float64(i * c));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(t * z), $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, -4e+164], t$95$1, If[LessEqual[t$95$2, 4e+55], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+211], t$95$1, N[(N[(-2.0 * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := 2 \cdot \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right)\\
            t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
            \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+164}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+55}:\\
            \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
            
            \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+211}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(i \cdot c\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4e164 or 4.00000000000000004e55 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999995e211

              1. Initial program 85.8%

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

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

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

              if -4e164 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000004e55

              1. Initial program 100.0%

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

                \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
              4. Step-by-step derivation
                1. Applied rewrites93.4%

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

                if 4.9999999999999995e211 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                1. Initial program 78.9%

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

                  \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. Applied rewrites93.8%

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
                  2. Step-by-step derivation
                    1. Applied rewrites96.8%

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

                  Alternative 4: 94.3% accurate, 0.5× speedup?

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

                    1. Initial program 75.5%

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

                        \[\leadsto \color{blue}{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. *-commutativeN/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, \color{blue}{t \cdot z}\right) \cdot 2 \]
                    6. Step-by-step derivation
                      1. Applied rewrites95.3%

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

                      if -1.0000000000000001e287 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000001e276

                      1. Initial program 99.9%

                        \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
                      2. Add Preprocessing
                      3. 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. +-commutativeN/A

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

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

                          \[\leadsto 2 \cdot \left(\color{blue}{z \cdot t} + \left(x \cdot y - \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(z, t, x \cdot y - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
                        7. lower--.f6499.9

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

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

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

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

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

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

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

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

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

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

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

                      if 5.00000000000000001e276 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                      1. Initial program 75.1%

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

                        \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                      4. Step-by-step derivation
                        1. Applied rewrites97.9%

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

                      Alternative 5: 85.9% accurate, 0.5× speedup?

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

                        1. Initial program 76.0%

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

                            \[\leadsto \color{blue}{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. *-commutativeN/A

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

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

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

                          \[\leadsto \mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, \color{blue}{t \cdot z}\right) \cdot 2 \]
                        6. Step-by-step derivation
                          1. Applied rewrites95.4%

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

                          if -1.00000000000000003e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e141

                          1. Initial program 99.9%

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

                              \[\leadsto \color{blue}{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. *-commutativeN/A

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

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

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{b \cdot \left(c \cdot i\right)}, -c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \cdot 2 \]
                          6. Step-by-step derivation
                            1. Applied rewrites91.4%

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

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

                            1. Initial program 80.8%

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

                              \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                            4. Step-by-step derivation
                              1. Applied rewrites90.2%

                                \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
                              2. Step-by-step derivation
                                1. Applied rewrites94.3%

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

                              Alternative 6: 81.2% accurate, 0.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+286} \lor \neg \left(t\_1 \leq 10^{+203}\right):\\ \;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (let* ((t_1 (* (* (+ a (* b c)) c) i)))
                                 (if (or (<= t_1 -1e+286) (not (<= t_1 1e+203)))
                                   (* (* -2.0 (* (fma c b a) i)) c)
                                   (* 2.0 (fma t z (* y x))))))
                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                              	double t_1 = ((a + (b * c)) * c) * i;
                              	double tmp;
                              	if ((t_1 <= -1e+286) || !(t_1 <= 1e+203)) {
                              		tmp = (-2.0 * (fma(c, b, a) * i)) * c;
                              	} else {
                              		tmp = 2.0 * fma(t, z, (y * x));
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t, a, b, c, i)
                              	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
                              	tmp = 0.0
                              	if ((t_1 <= -1e+286) || !(t_1 <= 1e+203))
                              		tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c);
                              	else
                              		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+286], N[Not[LessEqual[t$95$1, 1e+203]], $MachinePrecision]], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
                              \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+286} \lor \neg \left(t\_1 \leq 10^{+203}\right):\\
                              \;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000003e286 or 9.9999999999999999e202 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                1. Initial program 78.0%

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

                                  \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites91.9%

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

                                  if -1.00000000000000003e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999999e202

                                  1. Initial program 99.9%

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

                                    \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites84.8%

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

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

                                  Alternative 7: 81.6% accurate, 0.6× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+164} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+115}\right):\\ \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot -2\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a b c i)
                                   :precision binary64
                                   (let* ((t_1 (* (* (+ a (* b c)) c) i)))
                                     (if (or (<= t_1 -4e+164) (not (<= t_1 5e+115)))
                                       (* (* (* (fma b c a) c) -2.0) i)
                                       (* 2.0 (fma t z (* y x))))))
                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                  	double t_1 = ((a + (b * c)) * c) * i;
                                  	double tmp;
                                  	if ((t_1 <= -4e+164) || !(t_1 <= 5e+115)) {
                                  		tmp = ((fma(b, c, a) * c) * -2.0) * i;
                                  	} else {
                                  		tmp = 2.0 * fma(t, z, (y * x));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(x, y, z, t, a, b, c, i)
                                  	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
                                  	tmp = 0.0
                                  	if ((t_1 <= -4e+164) || !(t_1 <= 5e+115))
                                  		tmp = Float64(Float64(Float64(fma(b, c, a) * c) * -2.0) * i);
                                  	else
                                  		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+164], N[Not[LessEqual[t$95$1, 5e+115]], $MachinePrecision]], N[(N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision] * i), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
                                  \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+164} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+115}\right):\\
                                  \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot -2\right) \cdot i\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4e164 or 5.00000000000000008e115 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                    1. Initial program 81.9%

                                      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
                                    2. Add Preprocessing
                                    3. 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(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
                                      3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites77.1%

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

                                      if -4e164 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000008e115

                                      1. Initial program 100.0%

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

                                        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites92.1%

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

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

                                      Alternative 8: 81.9% accurate, 0.6× speedup?

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

                                        1. Initial program 76.0%

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

                                          \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites88.9%

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

                                          if -1.00000000000000003e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000008e115

                                          1. Initial program 99.9%

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

                                            \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites88.3%

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

                                            if 5.00000000000000008e115 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                            1. Initial program 82.7%

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

                                              \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites86.2%

                                                \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites89.9%

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

                                              Alternative 9: 72.6% accurate, 0.6× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+286} \lor \neg \left(t\_1 \leq 10^{+203}\right):\\ \;\;\;\;\left(\left(\left(b \cdot c\right) \cdot i\right) \cdot -2\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
                                              (FPCore (x y z t a b c i)
                                               :precision binary64
                                               (let* ((t_1 (* (* (+ a (* b c)) c) i)))
                                                 (if (or (<= t_1 -1e+286) (not (<= t_1 1e+203)))
                                                   (* (* (* (* b c) i) -2.0) c)
                                                   (* 2.0 (fma t z (* y x))))))
                                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                              	double t_1 = ((a + (b * c)) * c) * i;
                                              	double tmp;
                                              	if ((t_1 <= -1e+286) || !(t_1 <= 1e+203)) {
                                              		tmp = (((b * c) * i) * -2.0) * c;
                                              	} else {
                                              		tmp = 2.0 * fma(t, z, (y * x));
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(x, y, z, t, a, b, c, i)
                                              	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
                                              	tmp = 0.0
                                              	if ((t_1 <= -1e+286) || !(t_1 <= 1e+203))
                                              		tmp = Float64(Float64(Float64(Float64(b * c) * i) * -2.0) * c);
                                              	else
                                              		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+286], N[Not[LessEqual[t$95$1, 1e+203]], $MachinePrecision]], N[(N[(N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
                                              \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+286} \lor \neg \left(t\_1 \leq 10^{+203}\right):\\
                                              \;\;\;\;\left(\left(\left(b \cdot c\right) \cdot i\right) \cdot -2\right) \cdot c\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000003e286 or 9.9999999999999999e202 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                                1. Initial program 78.0%

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

                                                  \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                                4. Step-by-step derivation
                                                  1. Applied rewrites91.9%

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

                                                    \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites70.0%

                                                      \[\leadsto \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c \]
                                                    2. Step-by-step derivation
                                                      1. Applied rewrites69.2%

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

                                                      if -1.00000000000000003e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999999e202

                                                      1. Initial program 99.9%

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

                                                        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites84.8%

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

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

                                                      Alternative 10: 72.9% accurate, 0.6× speedup?

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

                                                        1. Initial program 76.0%

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

                                                          \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites88.9%

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

                                                            \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites75.0%

                                                              \[\leadsto \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites75.0%

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

                                                              if -1.00000000000000003e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999999e202

                                                              1. Initial program 99.9%

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

                                                                \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites84.8%

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

                                                                if 9.9999999999999999e202 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                                                1. Initial program 79.3%

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

                                                                  \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                                                4. Step-by-step derivation
                                                                  1. Applied rewrites93.9%

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

                                                                    \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites66.7%

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

                                                                  Alternative 11: 63.0% accurate, 0.6× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+286} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+182}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
                                                                  (FPCore (x y z t a b c i)
                                                                   :precision binary64
                                                                   (let* ((t_1 (* (* (+ a (* b c)) c) i)))
                                                                     (if (or (<= t_1 -1e+286) (not (<= t_1 5e+182)))
                                                                       (* (* (* i c) a) -2.0)
                                                                       (* 2.0 (fma t z (* y x))))))
                                                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                  	double t_1 = ((a + (b * c)) * c) * i;
                                                                  	double tmp;
                                                                  	if ((t_1 <= -1e+286) || !(t_1 <= 5e+182)) {
                                                                  		tmp = ((i * c) * a) * -2.0;
                                                                  	} else {
                                                                  		tmp = 2.0 * fma(t, z, (y * x));
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  function code(x, y, z, t, a, b, c, i)
                                                                  	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
                                                                  	tmp = 0.0
                                                                  	if ((t_1 <= -1e+286) || !(t_1 <= 5e+182))
                                                                  		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
                                                                  	else
                                                                  		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+286], N[Not[LessEqual[t$95$1, 5e+182]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
                                                                  \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+286} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+182}\right):\\
                                                                  \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 2 regimes
                                                                  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000003e286 or 4.99999999999999973e182 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                                                    1. Initial program 78.5%

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

                                                                      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
                                                                    4. Step-by-step derivation
                                                                      1. Applied rewrites50.5%

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

                                                                      if -1.00000000000000003e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999973e182

                                                                      1. Initial program 99.9%

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

                                                                        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites85.8%

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

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

                                                                      Alternative 12: 42.3% accurate, 0.6× speedup?

                                                                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+153} \lor \neg \left(t\_1 \leq 7 \cdot 10^{+135}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
                                                                      (FPCore (x y z t a b c i)
                                                                       :precision binary64
                                                                       (let* ((t_1 (* (* (+ a (* b c)) c) i)))
                                                                         (if (or (<= t_1 -1e+153) (not (<= t_1 7e+135)))
                                                                           (* (* (* i c) a) -2.0)
                                                                           (* 2.0 (* y x)))))
                                                                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                      	double t_1 = ((a + (b * c)) * c) * i;
                                                                      	double tmp;
                                                                      	if ((t_1 <= -1e+153) || !(t_1 <= 7e+135)) {
                                                                      		tmp = ((i * c) * a) * -2.0;
                                                                      	} else {
                                                                      		tmp = 2.0 * (y * x);
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      module fmin_fmax_functions
                                                                          implicit none
                                                                          private
                                                                          public fmax
                                                                          public fmin
                                                                      
                                                                          interface fmax
                                                                              module procedure fmax88
                                                                              module procedure fmax44
                                                                              module procedure fmax84
                                                                              module procedure fmax48
                                                                          end interface
                                                                          interface fmin
                                                                              module procedure fmin88
                                                                              module procedure fmin44
                                                                              module procedure fmin84
                                                                              module procedure fmin48
                                                                          end interface
                                                                      contains
                                                                          real(8) function fmax88(x, y) result (res)
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(4) function fmax44(x, y) result (res)
                                                                              real(4), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmax84(x, y) result(res)
                                                                              real(8), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmax48(x, y) result(res)
                                                                              real(4), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin88(x, y) result (res)
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(4) function fmin44(x, y) result (res)
                                                                              real(4), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin84(x, y) result(res)
                                                                              real(8), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin48(x, y) result(res)
                                                                              real(4), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                          end function
                                                                      end module
                                                                      
                                                                      real(8) function code(x, y, z, t, a, b, c, i)
                                                                      use fmin_fmax_functions
                                                                          real(8), intent (in) :: x
                                                                          real(8), intent (in) :: y
                                                                          real(8), intent (in) :: z
                                                                          real(8), intent (in) :: t
                                                                          real(8), intent (in) :: a
                                                                          real(8), intent (in) :: b
                                                                          real(8), intent (in) :: c
                                                                          real(8), intent (in) :: i
                                                                          real(8) :: t_1
                                                                          real(8) :: tmp
                                                                          t_1 = ((a + (b * c)) * c) * i
                                                                          if ((t_1 <= (-1d+153)) .or. (.not. (t_1 <= 7d+135))) then
                                                                              tmp = ((i * c) * a) * (-2.0d0)
                                                                          else
                                                                              tmp = 2.0d0 * (y * x)
                                                                          end if
                                                                          code = tmp
                                                                      end function
                                                                      
                                                                      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                      	double t_1 = ((a + (b * c)) * c) * i;
                                                                      	double tmp;
                                                                      	if ((t_1 <= -1e+153) || !(t_1 <= 7e+135)) {
                                                                      		tmp = ((i * c) * a) * -2.0;
                                                                      	} else {
                                                                      		tmp = 2.0 * (y * x);
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      def code(x, y, z, t, a, b, c, i):
                                                                      	t_1 = ((a + (b * c)) * c) * i
                                                                      	tmp = 0
                                                                      	if (t_1 <= -1e+153) or not (t_1 <= 7e+135):
                                                                      		tmp = ((i * c) * a) * -2.0
                                                                      	else:
                                                                      		tmp = 2.0 * (y * x)
                                                                      	return tmp
                                                                      
                                                                      function code(x, y, z, t, a, b, c, i)
                                                                      	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
                                                                      	tmp = 0.0
                                                                      	if ((t_1 <= -1e+153) || !(t_1 <= 7e+135))
                                                                      		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
                                                                      	else
                                                                      		tmp = Float64(2.0 * Float64(y * x));
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                      	t_1 = ((a + (b * c)) * c) * i;
                                                                      	tmp = 0.0;
                                                                      	if ((t_1 <= -1e+153) || ~((t_1 <= 7e+135)))
                                                                      		tmp = ((i * c) * a) * -2.0;
                                                                      	else
                                                                      		tmp = 2.0 * (y * x);
                                                                      	end
                                                                      	tmp_2 = tmp;
                                                                      end
                                                                      
                                                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+153], N[Not[LessEqual[t$95$1, 7e+135]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \begin{array}{l}
                                                                      t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
                                                                      \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+153} \lor \neg \left(t\_1 \leq 7 \cdot 10^{+135}\right):\\
                                                                      \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;2 \cdot \left(y \cdot x\right)\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 2 regimes
                                                                      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e153 or 7.0000000000000005e135 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                                                        1. Initial program 81.3%

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

                                                                          \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
                                                                        4. Step-by-step derivation
                                                                          1. Applied rewrites47.2%

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

                                                                          if -1e153 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 7.0000000000000005e135

                                                                          1. Initial program 100.0%

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

                                                                            \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites53.4%

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

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

                                                                          Alternative 13: 95.9% accurate, 0.7× speedup?

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

                                                                            1. Initial program 94.7%

                                                                              \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
                                                                            2. Add Preprocessing
                                                                            3. Step-by-step derivation
                                                                              1. lift--.f64N/A

                                                                                \[\leadsto 2 \cdot \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(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
                                                                              3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                            if 5.00000000000000001e276 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                                                                            1. Initial program 75.1%

                                                                              \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
                                                                            2. Add Preprocessing
                                                                            3. 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(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
                                                                              3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          Alternative 14: 41.6% accurate, 0.8× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot x\right)\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 10^{-270}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-20}:\\ \;\;\;\;\left(\left(a \cdot i\right) \cdot -2\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                                          (FPCore (x y z t a b c i)
                                                                           :precision binary64
                                                                           (let* ((t_1 (* 2.0 (* y x))))
                                                                             (if (<= (* x y) -1e+70)
                                                                               t_1
                                                                               (if (<= (* x y) 1e-270)
                                                                                 (* 2.0 (* t z))
                                                                                 (if (<= (* x y) 4e-20) (* (* (* a i) -2.0) c) t_1)))))
                                                                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                          	double t_1 = 2.0 * (y * x);
                                                                          	double tmp;
                                                                          	if ((x * y) <= -1e+70) {
                                                                          		tmp = t_1;
                                                                          	} else if ((x * y) <= 1e-270) {
                                                                          		tmp = 2.0 * (t * z);
                                                                          	} else if ((x * y) <= 4e-20) {
                                                                          		tmp = ((a * i) * -2.0) * c;
                                                                          	} 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 = 2.0d0 * (y * x)
                                                                              if ((x * y) <= (-1d+70)) then
                                                                                  tmp = t_1
                                                                              else if ((x * y) <= 1d-270) then
                                                                                  tmp = 2.0d0 * (t * z)
                                                                              else if ((x * y) <= 4d-20) then
                                                                                  tmp = ((a * i) * (-2.0d0)) * c
                                                                              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 = 2.0 * (y * x);
                                                                          	double tmp;
                                                                          	if ((x * y) <= -1e+70) {
                                                                          		tmp = t_1;
                                                                          	} else if ((x * y) <= 1e-270) {
                                                                          		tmp = 2.0 * (t * z);
                                                                          	} else if ((x * y) <= 4e-20) {
                                                                          		tmp = ((a * i) * -2.0) * c;
                                                                          	} else {
                                                                          		tmp = t_1;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          def code(x, y, z, t, a, b, c, i):
                                                                          	t_1 = 2.0 * (y * x)
                                                                          	tmp = 0
                                                                          	if (x * y) <= -1e+70:
                                                                          		tmp = t_1
                                                                          	elif (x * y) <= 1e-270:
                                                                          		tmp = 2.0 * (t * z)
                                                                          	elif (x * y) <= 4e-20:
                                                                          		tmp = ((a * i) * -2.0) * c
                                                                          	else:
                                                                          		tmp = t_1
                                                                          	return tmp
                                                                          
                                                                          function code(x, y, z, t, a, b, c, i)
                                                                          	t_1 = Float64(2.0 * Float64(y * x))
                                                                          	tmp = 0.0
                                                                          	if (Float64(x * y) <= -1e+70)
                                                                          		tmp = t_1;
                                                                          	elseif (Float64(x * y) <= 1e-270)
                                                                          		tmp = Float64(2.0 * Float64(t * z));
                                                                          	elseif (Float64(x * y) <= 4e-20)
                                                                          		tmp = Float64(Float64(Float64(a * i) * -2.0) * c);
                                                                          	else
                                                                          		tmp = t_1;
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                          	t_1 = 2.0 * (y * x);
                                                                          	tmp = 0.0;
                                                                          	if ((x * y) <= -1e+70)
                                                                          		tmp = t_1;
                                                                          	elseif ((x * y) <= 1e-270)
                                                                          		tmp = 2.0 * (t * z);
                                                                          	elseif ((x * y) <= 4e-20)
                                                                          		tmp = ((a * i) * -2.0) * c;
                                                                          	else
                                                                          		tmp = t_1;
                                                                          	end
                                                                          	tmp_2 = tmp;
                                                                          end
                                                                          
                                                                          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+70], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-270], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e-20], N[(N[(N[(a * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          t_1 := 2 \cdot \left(y \cdot x\right)\\
                                                                          \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+70}:\\
                                                                          \;\;\;\;t\_1\\
                                                                          
                                                                          \mathbf{elif}\;x \cdot y \leq 10^{-270}:\\
                                                                          \;\;\;\;2 \cdot \left(t \cdot z\right)\\
                                                                          
                                                                          \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-20}:\\
                                                                          \;\;\;\;\left(\left(a \cdot i\right) \cdot -2\right) \cdot c\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;t\_1\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 3 regimes
                                                                          2. if (*.f64 x y) < -1.00000000000000007e70 or 3.99999999999999978e-20 < (*.f64 x y)

                                                                            1. Initial program 91.9%

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

                                                                              \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y\right)} \]
                                                                            4. Step-by-step derivation
                                                                              1. Applied rewrites58.6%

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

                                                                              if -1.00000000000000007e70 < (*.f64 x y) < 1e-270

                                                                              1. Initial program 89.6%

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

                                                                                \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. Applied rewrites39.7%

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

                                                                                if 1e-270 < (*.f64 x y) < 3.99999999999999978e-20

                                                                                1. Initial program 88.8%

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

                                                                                  \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites59.7%

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

                                                                                    \[\leadsto \left(-2 \cdot \left(a \cdot i\right)\right) \cdot c \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites43.3%

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

                                                                                  Alternative 15: 43.9% accurate, 1.2× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+70} \lor \neg \left(x \cdot y \leq 500\right):\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \end{array} \end{array} \]
                                                                                  (FPCore (x y z t a b c i)
                                                                                   :precision binary64
                                                                                   (if (or (<= (* x y) -1e+70) (not (<= (* x y) 500.0)))
                                                                                     (* 2.0 (* y x))
                                                                                     (* 2.0 (* t z))))
                                                                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                  	double tmp;
                                                                                  	if (((x * y) <= -1e+70) || !((x * y) <= 500.0)) {
                                                                                  		tmp = 2.0 * (y * x);
                                                                                  	} else {
                                                                                  		tmp = 2.0 * (t * z);
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  module fmin_fmax_functions
                                                                                      implicit none
                                                                                      private
                                                                                      public fmax
                                                                                      public fmin
                                                                                  
                                                                                      interface fmax
                                                                                          module procedure fmax88
                                                                                          module procedure fmax44
                                                                                          module procedure fmax84
                                                                                          module procedure fmax48
                                                                                      end interface
                                                                                      interface fmin
                                                                                          module procedure fmin88
                                                                                          module procedure fmin44
                                                                                          module procedure fmin84
                                                                                          module procedure fmin48
                                                                                      end interface
                                                                                  contains
                                                                                      real(8) function fmax88(x, y) result (res)
                                                                                          real(8), intent (in) :: x
                                                                                          real(8), intent (in) :: y
                                                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                      end function
                                                                                      real(4) function fmax44(x, y) result (res)
                                                                                          real(4), intent (in) :: x
                                                                                          real(4), intent (in) :: y
                                                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                      end function
                                                                                      real(8) function fmax84(x, y) result(res)
                                                                                          real(8), intent (in) :: x
                                                                                          real(4), intent (in) :: y
                                                                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                      end function
                                                                                      real(8) function fmax48(x, y) result(res)
                                                                                          real(4), intent (in) :: x
                                                                                          real(8), intent (in) :: y
                                                                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                      end function
                                                                                      real(8) function fmin88(x, y) result (res)
                                                                                          real(8), intent (in) :: x
                                                                                          real(8), intent (in) :: y
                                                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                      end function
                                                                                      real(4) function fmin44(x, y) result (res)
                                                                                          real(4), intent (in) :: x
                                                                                          real(4), intent (in) :: y
                                                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                      end function
                                                                                      real(8) function fmin84(x, y) result(res)
                                                                                          real(8), intent (in) :: x
                                                                                          real(4), intent (in) :: y
                                                                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                      end function
                                                                                      real(8) function fmin48(x, y) result(res)
                                                                                          real(4), intent (in) :: x
                                                                                          real(8), intent (in) :: y
                                                                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                      end function
                                                                                  end module
                                                                                  
                                                                                  real(8) function code(x, y, z, t, a, b, c, i)
                                                                                  use fmin_fmax_functions
                                                                                      real(8), intent (in) :: x
                                                                                      real(8), intent (in) :: y
                                                                                      real(8), intent (in) :: z
                                                                                      real(8), intent (in) :: t
                                                                                      real(8), intent (in) :: a
                                                                                      real(8), intent (in) :: b
                                                                                      real(8), intent (in) :: c
                                                                                      real(8), intent (in) :: i
                                                                                      real(8) :: tmp
                                                                                      if (((x * y) <= (-1d+70)) .or. (.not. ((x * y) <= 500.0d0))) then
                                                                                          tmp = 2.0d0 * (y * x)
                                                                                      else
                                                                                          tmp = 2.0d0 * (t * z)
                                                                                      end if
                                                                                      code = tmp
                                                                                  end function
                                                                                  
                                                                                  public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                  	double tmp;
                                                                                  	if (((x * y) <= -1e+70) || !((x * y) <= 500.0)) {
                                                                                  		tmp = 2.0 * (y * x);
                                                                                  	} else {
                                                                                  		tmp = 2.0 * (t * z);
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  def code(x, y, z, t, a, b, c, i):
                                                                                  	tmp = 0
                                                                                  	if ((x * y) <= -1e+70) or not ((x * y) <= 500.0):
                                                                                  		tmp = 2.0 * (y * x)
                                                                                  	else:
                                                                                  		tmp = 2.0 * (t * z)
                                                                                  	return tmp
                                                                                  
                                                                                  function code(x, y, z, t, a, b, c, i)
                                                                                  	tmp = 0.0
                                                                                  	if ((Float64(x * y) <= -1e+70) || !(Float64(x * y) <= 500.0))
                                                                                  		tmp = Float64(2.0 * Float64(y * x));
                                                                                  	else
                                                                                  		tmp = Float64(2.0 * Float64(t * z));
                                                                                  	end
                                                                                  	return tmp
                                                                                  end
                                                                                  
                                                                                  function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                                  	tmp = 0.0;
                                                                                  	if (((x * y) <= -1e+70) || ~(((x * y) <= 500.0)))
                                                                                  		tmp = 2.0 * (y * x);
                                                                                  	else
                                                                                  		tmp = 2.0 * (t * z);
                                                                                  	end
                                                                                  	tmp_2 = tmp;
                                                                                  end
                                                                                  
                                                                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+70], N[Not[LessEqual[N[(x * y), $MachinePrecision], 500.0]], $MachinePrecision]], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]]
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+70} \lor \neg \left(x \cdot y \leq 500\right):\\
                                                                                  \;\;\;\;2 \cdot \left(y \cdot x\right)\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;2 \cdot \left(t \cdot z\right)\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 2 regimes
                                                                                  2. if (*.f64 x y) < -1.00000000000000007e70 or 500 < (*.f64 x y)

                                                                                    1. Initial program 91.8%

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

                                                                                      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y\right)} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. Applied rewrites59.1%

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

                                                                                      if -1.00000000000000007e70 < (*.f64 x y) < 500

                                                                                      1. Initial program 89.5%

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

                                                                                        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. Applied rewrites37.6%

                                                                                          \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
                                                                                      5. Recombined 2 regimes into one program.
                                                                                      6. Final simplification47.7%

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

                                                                                      Alternative 16: 28.5% accurate, 3.6× speedup?

                                                                                      \[\begin{array}{l} \\ 2 \cdot \left(t \cdot z\right) \end{array} \]
                                                                                      (FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* t z)))
                                                                                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                      	return 2.0 * (t * z);
                                                                                      }
                                                                                      
                                                                                      module fmin_fmax_functions
                                                                                          implicit none
                                                                                          private
                                                                                          public fmax
                                                                                          public fmin
                                                                                      
                                                                                          interface fmax
                                                                                              module procedure fmax88
                                                                                              module procedure fmax44
                                                                                              module procedure fmax84
                                                                                              module procedure fmax48
                                                                                          end interface
                                                                                          interface fmin
                                                                                              module procedure fmin88
                                                                                              module procedure fmin44
                                                                                              module procedure fmin84
                                                                                              module procedure fmin48
                                                                                          end interface
                                                                                      contains
                                                                                          real(8) function fmax88(x, y) result (res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(4) function fmax44(x, y) result (res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmax84(x, y) result(res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmax48(x, y) result(res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmin88(x, y) result (res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(4) function fmin44(x, y) result (res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmin84(x, y) result(res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmin48(x, y) result(res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                          end function
                                                                                      end module
                                                                                      
                                                                                      real(8) function code(x, y, z, t, a, b, c, i)
                                                                                      use fmin_fmax_functions
                                                                                          real(8), intent (in) :: x
                                                                                          real(8), intent (in) :: y
                                                                                          real(8), intent (in) :: z
                                                                                          real(8), intent (in) :: t
                                                                                          real(8), intent (in) :: a
                                                                                          real(8), intent (in) :: b
                                                                                          real(8), intent (in) :: c
                                                                                          real(8), intent (in) :: i
                                                                                          code = 2.0d0 * (t * z)
                                                                                      end function
                                                                                      
                                                                                      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                      	return 2.0 * (t * z);
                                                                                      }
                                                                                      
                                                                                      def code(x, y, z, t, a, b, c, i):
                                                                                      	return 2.0 * (t * z)
                                                                                      
                                                                                      function code(x, y, z, t, a, b, c, i)
                                                                                      	return Float64(2.0 * Float64(t * z))
                                                                                      end
                                                                                      
                                                                                      function tmp = code(x, y, z, t, a, b, c, i)
                                                                                      	tmp = 2.0 * (t * z);
                                                                                      end
                                                                                      
                                                                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      2 \cdot \left(t \cdot z\right)
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Initial program 90.6%

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

                                                                                        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. Applied rewrites26.9%

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

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

                                                                                        \[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \end{array} \]
                                                                                        (FPCore (x y z t a b c i)
                                                                                         :precision binary64
                                                                                         (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
                                                                                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                        	return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
                                                                                        }
                                                                                        
                                                                                        module fmin_fmax_functions
                                                                                            implicit none
                                                                                            private
                                                                                            public fmax
                                                                                            public fmin
                                                                                        
                                                                                            interface fmax
                                                                                                module procedure fmax88
                                                                                                module procedure fmax44
                                                                                                module procedure fmax84
                                                                                                module procedure fmax48
                                                                                            end interface
                                                                                            interface fmin
                                                                                                module procedure fmin88
                                                                                                module procedure fmin44
                                                                                                module procedure fmin84
                                                                                                module procedure fmin48
                                                                                            end interface
                                                                                        contains
                                                                                            real(8) function fmax88(x, y) result (res)
                                                                                                real(8), intent (in) :: x
                                                                                                real(8), intent (in) :: y
                                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                            end function
                                                                                            real(4) function fmax44(x, y) result (res)
                                                                                                real(4), intent (in) :: x
                                                                                                real(4), intent (in) :: y
                                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                            end function
                                                                                            real(8) function fmax84(x, y) result(res)
                                                                                                real(8), intent (in) :: x
                                                                                                real(4), intent (in) :: y
                                                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                            end function
                                                                                            real(8) function fmax48(x, y) result(res)
                                                                                                real(4), intent (in) :: x
                                                                                                real(8), intent (in) :: y
                                                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                            end function
                                                                                            real(8) function fmin88(x, y) result (res)
                                                                                                real(8), intent (in) :: x
                                                                                                real(8), intent (in) :: y
                                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                            end function
                                                                                            real(4) function fmin44(x, y) result (res)
                                                                                                real(4), intent (in) :: x
                                                                                                real(4), intent (in) :: y
                                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                            end function
                                                                                            real(8) function fmin84(x, y) result(res)
                                                                                                real(8), intent (in) :: x
                                                                                                real(4), intent (in) :: y
                                                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                            end function
                                                                                            real(8) function fmin48(x, y) result(res)
                                                                                                real(4), intent (in) :: x
                                                                                                real(8), intent (in) :: y
                                                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                            end function
                                                                                        end module
                                                                                        
                                                                                        real(8) function code(x, y, z, t, a, b, c, i)
                                                                                        use fmin_fmax_functions
                                                                                            real(8), intent (in) :: x
                                                                                            real(8), intent (in) :: y
                                                                                            real(8), intent (in) :: z
                                                                                            real(8), intent (in) :: t
                                                                                            real(8), intent (in) :: a
                                                                                            real(8), intent (in) :: b
                                                                                            real(8), intent (in) :: c
                                                                                            real(8), intent (in) :: i
                                                                                            code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
                                                                                        end function
                                                                                        
                                                                                        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                        	return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
                                                                                        }
                                                                                        
                                                                                        def code(x, y, z, t, a, b, c, i):
                                                                                        	return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
                                                                                        
                                                                                        function code(x, y, z, t, a, b, c, i)
                                                                                        	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i))))
                                                                                        end
                                                                                        
                                                                                        function tmp = code(x, y, z, t, a, b, c, i)
                                                                                        	tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
                                                                                        end
                                                                                        
                                                                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                        
                                                                                        \begin{array}{l}
                                                                                        
                                                                                        \\
                                                                                        2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
                                                                                        \end{array}
                                                                                        

                                                                                        Reproduce

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