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

Percentage Accurate: 90.1% → 95.9%
Time: 30.4s
Alternatives: 14
Speedup: 0.5×

Specification

?
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
(FPCore (x y z t a b c i)
  :precision binary64
  (* 2 (- (+ (* 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 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 90.1% accurate, 1.0× speedup?

\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
(FPCore (x y z t a b c i)
  :precision binary64
  (* 2 (- (+ (* 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 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)

Alternative 1: 95.9% accurate, 0.5× speedup?

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

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \color{blue}{i}\right)\right)\right) \]
      2. lower-*.f6435.0%

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

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

Alternative 2: 94.5% accurate, 0.5× speedup?

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

\mathbf{elif}\;t\_3 \leq 500000000000000008608032298368227414415543912506619491164446008946190335622287523993960225937729797284303069430849145530155524612766474260348469402855720325061314257334714230178496312484014164775344612087642173365030358044414607127719847315059897273252756207808991071631335431459408181431059577374563631104:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_3 \cdot i\right)\\

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.0000000000000001e305

    1. Initial program 90.1%

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

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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

Alternative 3: 83.6% accurate, 0.5× speedup?

\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := c \cdot \left(i \cdot t\_1\right)\\ t_3 := t\_1 \cdot c\\ \mathbf{if}\;t\_3 \leq -999999999999999943801810948794571024057224129020550531544123892056457216:\\ \;\;\;\;2 \cdot \left(t \cdot z - t\_2\right)\\ \mathbf{elif}\;t\_3 \leq 500000000000000008608032298368227414415543912506619491164446008946190335622287523993960225937729797284303069430849145530155524612766474260348469402855720325061314257334714230178496312484014164775344612087642173365030358044414607127719847315059897273252756207808991071631335431459408181431059577374563631104:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(b \cdot c\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\ \end{array} \]
(FPCore (x y z t a b c i)
  :precision binary64
  (let* ((t_1 (+ a (* b c))) (t_2 (* c (* i t_1))) (t_3 (* t_1 c)))
  (if (<=
       t_3
       -999999999999999943801810948794571024057224129020550531544123892056457216)
    (* 2 (- (* t z) t_2))
    (if (<=
         t_3
         500000000000000008608032298368227414415543912506619491164446008946190335622287523993960225937729797284303069430849145530155524612766474260348469402855720325061314257334714230178496312484014164775344612087642173365030358044414607127719847315059897273252756207808991071631335431459408181431059577374563631104)
      (* 2 (- (+ (* x y) (* z t)) (* (* b c) (* i c))))
      (* 2 (- (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = c * (i * t_1);
	double t_3 = t_1 * c;
	double tmp;
	if (t_3 <= -1e+72) {
		tmp = 2.0 * ((t * z) - t_2);
	} else if (t_3 <= 5e+305) {
		tmp = 2.0 * (((x * y) + (z * t)) - ((b * c) * (i * c)));
	} else {
		tmp = 2.0 * ((x * y) - t_2);
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = a + (b * c)
    t_2 = c * (i * t_1)
    t_3 = t_1 * c
    if (t_3 <= (-1d+72)) then
        tmp = 2.0d0 * ((t * z) - t_2)
    else if (t_3 <= 5d+305) then
        tmp = 2.0d0 * (((x * y) + (z * t)) - ((b * c) * (i * c)))
    else
        tmp = 2.0d0 * ((x * y) - t_2)
    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);
	double t_2 = c * (i * t_1);
	double t_3 = t_1 * c;
	double tmp;
	if (t_3 <= -1e+72) {
		tmp = 2.0 * ((t * z) - t_2);
	} else if (t_3 <= 5e+305) {
		tmp = 2.0 * (((x * y) + (z * t)) - ((b * c) * (i * c)));
	} else {
		tmp = 2.0 * ((x * y) - t_2);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = c * (i * t_1)
	t_3 = t_1 * c
	tmp = 0
	if t_3 <= -1e+72:
		tmp = 2.0 * ((t * z) - t_2)
	elif t_3 <= 5e+305:
		tmp = 2.0 * (((x * y) + (z * t)) - ((b * c) * (i * c)))
	else:
		tmp = 2.0 * ((x * y) - t_2)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(c * Float64(i * t_1))
	t_3 = Float64(t_1 * c)
	tmp = 0.0
	if (t_3 <= -1e+72)
		tmp = Float64(2.0 * Float64(Float64(t * z) - t_2));
	elseif (t_3 <= 5e+305)
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(b * c) * Float64(i * c))));
	else
		tmp = Float64(2.0 * Float64(Float64(x * y) - t_2));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = c * (i * t_1);
	t_3 = t_1 * c;
	tmp = 0.0;
	if (t_3 <= -1e+72)
		tmp = 2.0 * ((t * z) - t_2);
	elseif (t_3 <= 5e+305)
		tmp = 2.0 * (((x * y) + (z * t)) - ((b * c) * (i * c)));
	else
		tmp = 2.0 * ((x * y) - t_2);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * c), $MachinePrecision]}, If[LessEqual[t$95$3, -999999999999999943801810948794571024057224129020550531544123892056457216], N[(2 * N[(N[(t * z), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 500000000000000008608032298368227414415543912506619491164446008946190335622287523993960225937729797284303069430849145530155524612766474260348469402855720325061314257334714230178496312484014164775344612087642173365030358044414607127719847315059897273252756207808991071631335431459408181431059577374563631104], N[(2 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(b * c), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(i \cdot t\_1\right)\\
t_3 := t\_1 \cdot c\\
\mathbf{if}\;t\_3 \leq -999999999999999943801810948794571024057224129020550531544123892056457216:\\
\;\;\;\;2 \cdot \left(t \cdot z - t\_2\right)\\

\mathbf{elif}\;t\_3 \leq 500000000000000008608032298368227414415543912506619491164446008946190335622287523993960225937729797284303069430849145530155524612766474260348469402855720325061314257334714230178496312484014164775344612087642173365030358044414607127719847315059897273252756207808991071631335431459408181431059577374563631104:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(b \cdot c\right) \cdot \left(i \cdot c\right)\right)\\

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999994e71 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.0000000000000001e305

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

Alternative 4: 81.3% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999996e-81 < (*.f64 z t) < 1.0000000000000001e70

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e70 < (*.f64 z t)

    1. Initial program 90.1%

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

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

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

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

Alternative 5: 76.7% accurate, 0.1× speedup?

\[\begin{array}{l} t_1 := c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\\ \mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1420000000000000073174970627690863766429315022300544608071317247421342278249105578327992696832:\\ \;\;\;\;2 \cdot \left(\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) - t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\ \end{array} \]
(FPCore (x y z t a b c i)
  :precision binary64
  (let* ((t_1 (* c (* i (+ a (* b c))))))
  (if (<=
       (fmin x y)
       -1420000000000000073174970627690863766429315022300544608071317247421342278249105578327992696832)
    (* 2 (- (* (fmin x y) (fmax x y)) t_1))
    (* 2 (- (* t z) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = c * (i * (a + (b * c)));
	double tmp;
	if (fmin(x, y) <= -1.42e+93) {
		tmp = 2.0 * ((fmin(x, y) * fmax(x, y)) - t_1);
	} else {
		tmp = 2.0 * ((t * z) - 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 = c * (i * (a + (b * c)))
    if (fmin(x, y) <= (-1.42d+93)) then
        tmp = 2.0d0 * ((fmin(x, y) * fmax(x, y)) - t_1)
    else
        tmp = 2.0d0 * ((t * z) - 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 = c * (i * (a + (b * c)));
	double tmp;
	if (fmin(x, y) <= -1.42e+93) {
		tmp = 2.0 * ((fmin(x, y) * fmax(x, y)) - t_1);
	} else {
		tmp = 2.0 * ((t * z) - t_1);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = c * (i * (a + (b * c)))
	tmp = 0
	if fmin(x, y) <= -1.42e+93:
		tmp = 2.0 * ((fmin(x, y) * fmax(x, y)) - t_1)
	else:
		tmp = 2.0 * ((t * z) - t_1)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(c * Float64(i * Float64(a + Float64(b * c))))
	tmp = 0.0
	if (fmin(x, y) <= -1.42e+93)
		tmp = Float64(2.0 * Float64(Float64(fmin(x, y) * fmax(x, y)) - t_1));
	else
		tmp = Float64(2.0 * Float64(Float64(t * z) - t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = c * (i * (a + (b * c)));
	tmp = 0.0;
	if (min(x, y) <= -1.42e+93)
		tmp = 2.0 * ((min(x, y) * max(x, y)) - t_1);
	else
		tmp = 2.0 * ((t * z) - t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[x, y], $MachinePrecision], -1420000000000000073174970627690863766429315022300544608071317247421342278249105578327992696832], N[(2 * N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1420000000000000073174970627690863766429315022300544608071317247421342278249105578327992696832:\\
\;\;\;\;2 \cdot \left(\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) - t\_1\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4200000000000001e93

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

    if -1.4200000000000001e93 < x

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

Alternative 6: 76.1% accurate, 0.7× speedup?

\[\begin{array}{l} t_1 := \left(x + x\right) \cdot y\\ \mathbf{if}\;x \cdot y \leq -50000000000000002964190062040743501853181244383522664432425037241499788914236990326011648254009062284575896118646691474114848581757291200512:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 1999999999999999930168777770965038835185710261252187684342087190381666372798103074634393633413599250594442956032371041455348337279889700577699244710948244690953092785150999379963096696036126558244456821968375010450997248:\\ \;\;\;\;2 \cdot \left(t \cdot z - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i)
  :precision binary64
  (let* ((t_1 (* (+ x x) y)))
  (if (<=
       (* x y)
       -50000000000000002964190062040743501853181244383522664432425037241499788914236990326011648254009062284575896118646691474114848581757291200512)
    t_1
    (if (<=
         (* x y)
         1999999999999999930168777770965038835185710261252187684342087190381666372798103074634393633413599250594442956032371041455348337279889700577699244710948244690953092785150999379963096696036126558244456821968375010450997248)
      (* 2 (- (* t z) (* c (* i (+ a (* b c))))))
      t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + x) * y;
	double tmp;
	if ((x * y) <= -5e+139) {
		tmp = t_1;
	} else if ((x * y) <= 2e+219) {
		tmp = 2.0 * ((t * z) - (c * (i * (a + (b * 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 = (x + x) * y
    if ((x * y) <= (-5d+139)) then
        tmp = t_1
    else if ((x * y) <= 2d+219) then
        tmp = 2.0d0 * ((t * z) - (c * (i * (a + (b * 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 = (x + x) * y;
	double tmp;
	if ((x * y) <= -5e+139) {
		tmp = t_1;
	} else if ((x * y) <= 2e+219) {
		tmp = 2.0 * ((t * z) - (c * (i * (a + (b * c)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + x) * y
	tmp = 0
	if (x * y) <= -5e+139:
		tmp = t_1
	elif (x * y) <= 2e+219:
		tmp = 2.0 * ((t * z) - (c * (i * (a + (b * c)))))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + x) * y)
	tmp = 0.0
	if (Float64(x * y) <= -5e+139)
		tmp = t_1;
	elseif (Float64(x * y) <= 2e+219)
		tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(c * Float64(i * Float64(a + Float64(b * c))))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + x) * y;
	tmp = 0.0;
	if ((x * y) <= -5e+139)
		tmp = t_1;
	elseif ((x * y) <= 2e+219)
		tmp = 2.0 * ((t * z) - (c * (i * (a + (b * c)))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -50000000000000002964190062040743501853181244383522664432425037241499788914236990326011648254009062284575896118646691474114848581757291200512], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1999999999999999930168777770965038835185710261252187684342087190381666372798103074634393633413599250594442956032371041455348337279889700577699244710948244690953092785150999379963096696036126558244456821968375010450997248], N[(2 * N[(N[(t * z), $MachinePrecision] - N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + x\right) \cdot y\\
\mathbf{if}\;x \cdot y \leq -50000000000000002964190062040743501853181244383522664432425037241499788914236990326011648254009062284575896118646691474114848581757291200512:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 1999999999999999930168777770965038835185710261252187684342087190381666372798103074634393633413599250594442956032371041455348337279889700577699244710948244690953092785150999379963096696036126558244456821968375010450997248:\\
\;\;\;\;2 \cdot \left(t \cdot z - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -5.0000000000000003e139 or 1.9999999999999999e219 < (*.f64 x y)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + x\right) \cdot y \]
    11. Applied rewrites28.9%

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

    if -5.0000000000000003e139 < (*.f64 x y) < 1.9999999999999999e219

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

Alternative 7: 66.4% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq 1999999999999999930168777770965038835185710261252187684342087190381666372798103074634393633413599250594442956032371041455348337279889700577699244710948244690953092785150999379963096696036126558244456821968375010450997248:\\
\;\;\;\;2 \cdot \left(t \cdot z - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.9999999999999999e135 or 1.9999999999999999e219 < (*.f64 x y)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + x\right) \cdot y \]
    11. Applied rewrites28.9%

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

    if -1.9999999999999999e135 < (*.f64 x y) < 1.9999999999999999e219

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \left(b \cdot \left(c \cdot \color{blue}{i}\right)\right)\right) \]
      2. lower-*.f6457.9%

        \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \]
    7. Applied rewrites57.9%

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

Alternative 8: 66.0% accurate, 0.6× speedup?

\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := -2 \cdot \left(c \cdot \left(i \cdot t\_1\right)\right)\\ t_3 := \left(t\_1 \cdot c\right) \cdot i\\ \mathbf{if}\;t\_3 \leq -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 19999999999999999626973554412460083155631121439641162660196967440893695766559001679768595453565709161474725394008045163145540587374089871820031057920336098997774414447880409368397792528912679316975775902969160009805517042200828928981967925226381671772486580520849455849141021060282761167690006528:\\ \;\;\;\;2 \cdot \left(t \cdot z - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t a b c i)
  :precision binary64
  (let* ((t_1 (+ a (* b c)))
       (t_2 (* -2 (* c (* i t_1))))
       (t_3 (* (* t_1 c) i)))
  (if (<=
       t_3
       -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208)
    t_2
    (if (<=
         t_3
         19999999999999999626973554412460083155631121439641162660196967440893695766559001679768595453565709161474725394008045163145540587374089871820031057920336098997774414447880409368397792528912679316975775902969160009805517042200828928981967925226381671772486580520849455849141021060282761167690006528)
      (* 2 (- (* t z) (* a (* c i))))
      t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = -2.0 * (c * (i * t_1));
	double t_3 = (t_1 * c) * i;
	double tmp;
	if (t_3 <= -2e+100) {
		tmp = t_2;
	} else if (t_3 <= 2e+295) {
		tmp = 2.0 * ((t * z) - (a * (c * i)));
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = a + (b * c)
    t_2 = (-2.0d0) * (c * (i * t_1))
    t_3 = (t_1 * c) * i
    if (t_3 <= (-2d+100)) then
        tmp = t_2
    else if (t_3 <= 2d+295) then
        tmp = 2.0d0 * ((t * z) - (a * (c * i)))
    else
        tmp = t_2
    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);
	double t_2 = -2.0 * (c * (i * t_1));
	double t_3 = (t_1 * c) * i;
	double tmp;
	if (t_3 <= -2e+100) {
		tmp = t_2;
	} else if (t_3 <= 2e+295) {
		tmp = 2.0 * ((t * z) - (a * (c * i)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = -2.0 * (c * (i * t_1))
	t_3 = (t_1 * c) * i
	tmp = 0
	if t_3 <= -2e+100:
		tmp = t_2
	elif t_3 <= 2e+295:
		tmp = 2.0 * ((t * z) - (a * (c * i)))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(-2.0 * Float64(c * Float64(i * t_1)))
	t_3 = Float64(Float64(t_1 * c) * i)
	tmp = 0.0
	if (t_3 <= -2e+100)
		tmp = t_2;
	elseif (t_3 <= 2e+295)
		tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(a * Float64(c * i))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = -2.0 * (c * (i * t_1));
	t_3 = (t_1 * c) * i;
	tmp = 0.0;
	if (t_3 <= -2e+100)
		tmp = t_2;
	elseif (t_3 <= 2e+295)
		tmp = 2.0 * ((t * z) - (a * (c * i)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2 * N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208], t$95$2, If[LessEqual[t$95$3, 19999999999999999626973554412460083155631121439641162660196967440893695766559001679768595453565709161474725394008045163145540587374089871820031057920336098997774414447880409368397792528912679316975775902969160009805517042200828928981967925226381671772486580520849455849141021060282761167690006528], N[(2 * N[(N[(t * z), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := -2 \cdot \left(c \cdot \left(i \cdot t\_1\right)\right)\\
t_3 := \left(t\_1 \cdot c\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208:\\
\;\;\;\;t\_2\\

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

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

    if -2e100 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e295

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - a \cdot \left(c \cdot \color{blue}{i}\right)\right) \]
      4. lower-*.f6450.0%

        \[\leadsto 2 \cdot \left(t \cdot z - a \cdot \left(c \cdot i\right)\right) \]
    7. Applied rewrites50.0%

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

Alternative 9: 62.2% accurate, 0.6× speedup?

\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := -2 \cdot \left(c \cdot \left(i \cdot t\_1\right)\right)\\ t_3 := \left(t\_1 \cdot c\right) \cdot i\\ \mathbf{if}\;t\_3 \leq -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 100000000000000:\\ \;\;\;\;\left(z + z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t a b c i)
  :precision binary64
  (let* ((t_1 (+ a (* b c)))
       (t_2 (* -2 (* c (* i t_1))))
       (t_3 (* (* t_1 c) i)))
  (if (<=
       t_3
       -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208)
    t_2
    (if (<= t_3 100000000000000) (* (+ z z) t) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = -2.0 * (c * (i * t_1));
	double t_3 = (t_1 * c) * i;
	double tmp;
	if (t_3 <= -2e+100) {
		tmp = t_2;
	} else if (t_3 <= 1e+14) {
		tmp = (z + z) * t;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = a + (b * c)
    t_2 = (-2.0d0) * (c * (i * t_1))
    t_3 = (t_1 * c) * i
    if (t_3 <= (-2d+100)) then
        tmp = t_2
    else if (t_3 <= 1d+14) then
        tmp = (z + z) * t
    else
        tmp = t_2
    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);
	double t_2 = -2.0 * (c * (i * t_1));
	double t_3 = (t_1 * c) * i;
	double tmp;
	if (t_3 <= -2e+100) {
		tmp = t_2;
	} else if (t_3 <= 1e+14) {
		tmp = (z + z) * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = -2.0 * (c * (i * t_1))
	t_3 = (t_1 * c) * i
	tmp = 0
	if t_3 <= -2e+100:
		tmp = t_2
	elif t_3 <= 1e+14:
		tmp = (z + z) * t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(-2.0 * Float64(c * Float64(i * t_1)))
	t_3 = Float64(Float64(t_1 * c) * i)
	tmp = 0.0
	if (t_3 <= -2e+100)
		tmp = t_2;
	elseif (t_3 <= 1e+14)
		tmp = Float64(Float64(z + z) * t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = -2.0 * (c * (i * t_1));
	t_3 = (t_1 * c) * i;
	tmp = 0.0;
	if (t_3 <= -2e+100)
		tmp = t_2;
	elseif (t_3 <= 1e+14)
		tmp = (z + z) * t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2 * N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208], t$95$2, If[LessEqual[t$95$3, 100000000000000], N[(N[(z + z), $MachinePrecision] * t), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := -2 \cdot \left(c \cdot \left(i \cdot t\_1\right)\right)\\
t_3 := \left(t\_1 \cdot c\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq 100000000000000:\\
\;\;\;\;\left(z + z\right) \cdot t\\

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

    if -2e100 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e14

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + z\right) \cdot t \]
      7. lower-+.f6428.5%

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

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

Alternative 10: 51.8% accurate, 0.6× speedup?

\[\begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq 200000000000000007004399371886322346092160635596623651209740288:\\ \;\;\;\;\left(z + z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot c\right)\right)\right)\\ \end{array} \]
(FPCore (x y z t a b c i)
  :precision binary64
  (let* ((t_1 (* (* (+ a (* b c)) c) i)))
  (if (<=
       t_1
       -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208)
    (* -2 (* c (* b (* c i))))
    (if (<=
         t_1
         200000000000000007004399371886322346092160635596623651209740288)
      (* (+ z z) t)
      (* -2 (* c (* i (* b 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+100) {
		tmp = -2.0 * (c * (b * (c * i)));
	} else if (t_1 <= 2e+62) {
		tmp = (z + z) * t;
	} else {
		tmp = -2.0 * (c * (i * (b * c)));
	}
	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 <= (-2d+100)) then
        tmp = (-2.0d0) * (c * (b * (c * i)))
    else if (t_1 <= 2d+62) then
        tmp = (z + z) * t
    else
        tmp = (-2.0d0) * (c * (i * (b * c)))
    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 <= -2e+100) {
		tmp = -2.0 * (c * (b * (c * i)));
	} else if (t_1 <= 2e+62) {
		tmp = (z + z) * t;
	} else {
		tmp = -2.0 * (c * (i * (b * c)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((a + (b * c)) * c) * i
	tmp = 0
	if t_1 <= -2e+100:
		tmp = -2.0 * (c * (b * (c * i)))
	elif t_1 <= 2e+62:
		tmp = (z + z) * t
	else:
		tmp = -2.0 * (c * (i * (b * 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+100)
		tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i))));
	elseif (t_1 <= 2e+62)
		tmp = Float64(Float64(z + z) * t);
	else
		tmp = Float64(-2.0 * Float64(c * Float64(i * Float64(b * c))));
	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 <= -2e+100)
		tmp = -2.0 * (c * (b * (c * i)));
	elseif (t_1 <= 2e+62)
		tmp = (z + z) * t;
	else
		tmp = -2.0 * (c * (i * (b * c)));
	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[LessEqual[t$95$1, -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208], N[(-2 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 200000000000000007004399371886322346092160635596623651209740288], N[(N[(z + z), $MachinePrecision] * t), $MachinePrecision], N[(-2 * N[(c * N[(i * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

\mathbf{elif}\;t\_1 \leq 200000000000000007004399371886322346092160635596623651209740288:\\
\;\;\;\;\left(z + z\right) \cdot t\\

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \color{blue}{i}\right)\right)\right) \]
      2. lower-*.f6435.0%

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

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

    if -2e100 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e62

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + z\right) \cdot t \]
      7. lower-+.f6428.5%

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

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

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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \color{blue}{c}\right)\right)\right) \]
    11. Step-by-step derivation
      1. lower-*.f6434.2%

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

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

Alternative 11: 51.3% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 200000000000000007004399371886322346092160635596623651209740288:\\
\;\;\;\;\left(z + z\right) \cdot t\\

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \color{blue}{i}\right)\right)\right) \]
      2. lower-*.f6435.0%

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

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

    if -2e100 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e62

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + z\right) \cdot t \]
      7. lower-+.f6428.5%

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

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

Alternative 12: 43.2% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 49999999999999996817935346888379588682128536637850367824197203616790781390263537744466934972934737889905175913047028462275753320826571678718861312047100027800908598513606192840644312187019991381769159869603315753887179791468998581205839848470245141381120:\\
\;\;\;\;\left(z + z\right) \cdot t\\

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

    if -1e137 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999997e253

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + z\right) \cdot t \]
      7. lower-+.f6428.5%

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

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

Alternative 13: 41.9% accurate, 1.3× speedup?

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

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

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -5.0000000000000001e63 or 1e205 < (*.f64 x y)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + x\right) \cdot y \]
    11. Applied rewrites28.9%

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

    if -5.0000000000000001e63 < (*.f64 x y) < 1e205

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + z\right) \cdot t \]
      7. lower-+.f6428.5%

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

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

Alternative 14: 28.5% accurate, 4.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(z + z\right) \cdot t \]
    7. lower-+.f6428.5%

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

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

Reproduce

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