Expression, p6

Percentage Accurate: 94.3% → 99.6%
Time: 4.0s
Alternatives: 7
Speedup: 1.0×

Specification

?
\[\left(\left(\left(-14 \leq a \land a \leq -13\right) \land \left(-3 \leq b \land b \leq -2\right)\right) \land \left(3 \leq c \land c \leq 3.5\right)\right) \land \left(12.5 \leq d \land d \leq 13.5\right)\]
\[\begin{array}{l} \\ \left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \end{array} \]
(FPCore (a b c d) :precision binary64 (* (+ a (+ b (+ c d))) 2.0))
double code(double a, double b, double c, double d) {
	return (a + (b + (c + d))) * 2.0;
}
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(a, b, c, d)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = (a + (b + (c + d))) * 2.0d0
end function
public static double code(double a, double b, double c, double d) {
	return (a + (b + (c + d))) * 2.0;
}
def code(a, b, c, d):
	return (a + (b + (c + d))) * 2.0
function code(a, b, c, d)
	return Float64(Float64(a + Float64(b + Float64(c + d))) * 2.0)
end
function tmp = code(a, b, c, d)
	tmp = (a + (b + (c + d))) * 2.0;
end
code[a_, b_, c_, d_] := N[(N[(a + N[(b + N[(c + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}

\\
\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 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: 94.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \end{array} \]
(FPCore (a b c d) :precision binary64 (* (+ a (+ b (+ c d))) 2.0))
double code(double a, double b, double c, double d) {
	return (a + (b + (c + d))) * 2.0;
}
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(a, b, c, d)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = (a + (b + (c + d))) * 2.0d0
end function
public static double code(double a, double b, double c, double d) {
	return (a + (b + (c + d))) * 2.0;
}
def code(a, b, c, d):
	return (a + (b + (c + d))) * 2.0
function code(a, b, c, d)
	return Float64(Float64(a + Float64(b + Float64(c + d))) * 2.0)
end
function tmp = code(a, b, c, d)
	tmp = (a + (b + (c + d))) * 2.0;
end
code[a_, b_, c_, d_] := N[(N[(a + N[(b + N[(c + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}

\\
\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\end{array}

Alternative 1: 99.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(b + c \cdot \left(1 + \frac{a + d}{c}\right)\right) \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (* 2.0 (+ b (* c (+ 1.0 (/ (+ a d) c))))))
double code(double a, double b, double c, double d) {
	return 2.0 * (b + (c * (1.0 + ((a + d) / c))));
}
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(a, b, c, d)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = 2.0d0 * (b + (c * (1.0d0 + ((a + d) / c))))
end function
public static double code(double a, double b, double c, double d) {
	return 2.0 * (b + (c * (1.0 + ((a + d) / c))));
}
def code(a, b, c, d):
	return 2.0 * (b + (c * (1.0 + ((a + d) / c))))
function code(a, b, c, d)
	return Float64(2.0 * Float64(b + Float64(c * Float64(1.0 + Float64(Float64(a + d) / c)))))
end
function tmp = code(a, b, c, d)
	tmp = 2.0 * (b + (c * (1.0 + ((a + d) / c))));
end
code[a_, b_, c_, d_] := N[(2.0 * N[(b + N[(c * N[(1.0 + N[(N[(a + d), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(b + c \cdot \left(1 + \frac{a + d}{c}\right)\right)
\end{array}
Derivation
  1. Initial program 93.8%

    \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
  2. Add Preprocessing
  3. Taylor expanded in b around 0

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

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

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

        \[\leadsto 2 \cdot \left(b + c \cdot \color{blue}{\left(1 + \frac{a + d}{c}\right)}\right) \]
      2. Add Preprocessing

      Alternative 2: 19.1% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \leq -5 \cdot 10^{-6}:\\ \;\;\;\;\left(a + d\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c + b\right)\\ \end{array} \end{array} \]
      (FPCore (a b c d)
       :precision binary64
       (if (<= (* (+ a (+ b (+ c d))) 2.0) -5e-6) (* (+ a d) 2.0) (* 2.0 (+ c b))))
      double code(double a, double b, double c, double d) {
      	double tmp;
      	if (((a + (b + (c + d))) * 2.0) <= -5e-6) {
      		tmp = (a + d) * 2.0;
      	} else {
      		tmp = 2.0 * (c + b);
      	}
      	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(a, b, c, d)
      use fmin_fmax_functions
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: c
          real(8), intent (in) :: d
          real(8) :: tmp
          if (((a + (b + (c + d))) * 2.0d0) <= (-5d-6)) then
              tmp = (a + d) * 2.0d0
          else
              tmp = 2.0d0 * (c + b)
          end if
          code = tmp
      end function
      
      public static double code(double a, double b, double c, double d) {
      	double tmp;
      	if (((a + (b + (c + d))) * 2.0) <= -5e-6) {
      		tmp = (a + d) * 2.0;
      	} else {
      		tmp = 2.0 * (c + b);
      	}
      	return tmp;
      }
      
      def code(a, b, c, d):
      	tmp = 0
      	if ((a + (b + (c + d))) * 2.0) <= -5e-6:
      		tmp = (a + d) * 2.0
      	else:
      		tmp = 2.0 * (c + b)
      	return tmp
      
      function code(a, b, c, d)
      	tmp = 0.0
      	if (Float64(Float64(a + Float64(b + Float64(c + d))) * 2.0) <= -5e-6)
      		tmp = Float64(Float64(a + d) * 2.0);
      	else
      		tmp = Float64(2.0 * Float64(c + b));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, c, d)
      	tmp = 0.0;
      	if (((a + (b + (c + d))) * 2.0) <= -5e-6)
      		tmp = (a + d) * 2.0;
      	else
      		tmp = 2.0 * (c + b);
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_, d_] := If[LessEqual[N[(N[(a + N[(b + N[(c + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], -5e-6], N[(N[(a + d), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(c + b), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \leq -5 \cdot 10^{-6}:\\
      \;\;\;\;\left(a + d\right) \cdot 2\\
      
      \mathbf{else}:\\
      \;\;\;\;2 \cdot \left(c + b\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (+.f64 a (+.f64 b (+.f64 c d))) #s(literal 2 binary64)) < -5.00000000000000041e-6

        1. Initial program 92.7%

          \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
        2. Add Preprocessing
        3. Taylor expanded in d around inf

          \[\leadsto \left(a + \color{blue}{d}\right) \cdot 2 \]
        4. Step-by-step derivation
          1. Applied rewrites17.6%

            \[\leadsto \left(a + \color{blue}{d}\right) \cdot 2 \]

          if -5.00000000000000041e-6 < (*.f64 (+.f64 a (+.f64 b (+.f64 c d))) #s(literal 2 binary64))

          1. Initial program 94.4%

            \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
          2. Add Preprocessing
          3. Taylor expanded in c around 0

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

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

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

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

            Alternative 3: 18.5% accurate, 0.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \leq -5 \cdot 10^{-6}:\\ \;\;\;\;b \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c + b\right)\\ \end{array} \end{array} \]
            (FPCore (a b c d)
             :precision binary64
             (if (<= (* (+ a (+ b (+ c d))) 2.0) -5e-6) (* b 2.0) (* 2.0 (+ c b))))
            double code(double a, double b, double c, double d) {
            	double tmp;
            	if (((a + (b + (c + d))) * 2.0) <= -5e-6) {
            		tmp = b * 2.0;
            	} else {
            		tmp = 2.0 * (c + b);
            	}
            	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(a, b, c, d)
            use fmin_fmax_functions
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8), intent (in) :: c
                real(8), intent (in) :: d
                real(8) :: tmp
                if (((a + (b + (c + d))) * 2.0d0) <= (-5d-6)) then
                    tmp = b * 2.0d0
                else
                    tmp = 2.0d0 * (c + b)
                end if
                code = tmp
            end function
            
            public static double code(double a, double b, double c, double d) {
            	double tmp;
            	if (((a + (b + (c + d))) * 2.0) <= -5e-6) {
            		tmp = b * 2.0;
            	} else {
            		tmp = 2.0 * (c + b);
            	}
            	return tmp;
            }
            
            def code(a, b, c, d):
            	tmp = 0
            	if ((a + (b + (c + d))) * 2.0) <= -5e-6:
            		tmp = b * 2.0
            	else:
            		tmp = 2.0 * (c + b)
            	return tmp
            
            function code(a, b, c, d)
            	tmp = 0.0
            	if (Float64(Float64(a + Float64(b + Float64(c + d))) * 2.0) <= -5e-6)
            		tmp = Float64(b * 2.0);
            	else
            		tmp = Float64(2.0 * Float64(c + b));
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b, c, d)
            	tmp = 0.0;
            	if (((a + (b + (c + d))) * 2.0) <= -5e-6)
            		tmp = b * 2.0;
            	else
            		tmp = 2.0 * (c + b);
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_, c_, d_] := If[LessEqual[N[(N[(a + N[(b + N[(c + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], -5e-6], N[(b * 2.0), $MachinePrecision], N[(2.0 * N[(c + b), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \leq -5 \cdot 10^{-6}:\\
            \;\;\;\;b \cdot 2\\
            
            \mathbf{else}:\\
            \;\;\;\;2 \cdot \left(c + b\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 (+.f64 a (+.f64 b (+.f64 c d))) #s(literal 2 binary64)) < -5.00000000000000041e-6

              1. Initial program 92.7%

                \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
              2. Add Preprocessing
              3. Taylor expanded in b around inf

                \[\leadsto \color{blue}{b} \cdot 2 \]
              4. Step-by-step derivation
                1. Applied rewrites15.9%

                  \[\leadsto \color{blue}{b} \cdot 2 \]

                if -5.00000000000000041e-6 < (*.f64 (+.f64 a (+.f64 b (+.f64 c d))) #s(literal 2 binary64))

                1. Initial program 94.4%

                  \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
                2. Add Preprocessing
                3. Taylor expanded in c around 0

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

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

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

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

                  Alternative 4: 16.3% accurate, 0.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \leq -5 \cdot 10^{-6}:\\ \;\;\;\;b \cdot 2\\ \mathbf{else}:\\ \;\;\;\;c \cdot 2\\ \end{array} \end{array} \]
                  (FPCore (a b c d)
                   :precision binary64
                   (if (<= (* (+ a (+ b (+ c d))) 2.0) -5e-6) (* b 2.0) (* c 2.0)))
                  double code(double a, double b, double c, double d) {
                  	double tmp;
                  	if (((a + (b + (c + d))) * 2.0) <= -5e-6) {
                  		tmp = b * 2.0;
                  	} else {
                  		tmp = c * 2.0;
                  	}
                  	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(a, b, c, d)
                  use fmin_fmax_functions
                      real(8), intent (in) :: a
                      real(8), intent (in) :: b
                      real(8), intent (in) :: c
                      real(8), intent (in) :: d
                      real(8) :: tmp
                      if (((a + (b + (c + d))) * 2.0d0) <= (-5d-6)) then
                          tmp = b * 2.0d0
                      else
                          tmp = c * 2.0d0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double a, double b, double c, double d) {
                  	double tmp;
                  	if (((a + (b + (c + d))) * 2.0) <= -5e-6) {
                  		tmp = b * 2.0;
                  	} else {
                  		tmp = c * 2.0;
                  	}
                  	return tmp;
                  }
                  
                  def code(a, b, c, d):
                  	tmp = 0
                  	if ((a + (b + (c + d))) * 2.0) <= -5e-6:
                  		tmp = b * 2.0
                  	else:
                  		tmp = c * 2.0
                  	return tmp
                  
                  function code(a, b, c, d)
                  	tmp = 0.0
                  	if (Float64(Float64(a + Float64(b + Float64(c + d))) * 2.0) <= -5e-6)
                  		tmp = Float64(b * 2.0);
                  	else
                  		tmp = Float64(c * 2.0);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(a, b, c, d)
                  	tmp = 0.0;
                  	if (((a + (b + (c + d))) * 2.0) <= -5e-6)
                  		tmp = b * 2.0;
                  	else
                  		tmp = c * 2.0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[a_, b_, c_, d_] := If[LessEqual[N[(N[(a + N[(b + N[(c + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], -5e-6], N[(b * 2.0), $MachinePrecision], N[(c * 2.0), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \leq -5 \cdot 10^{-6}:\\
                  \;\;\;\;b \cdot 2\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;c \cdot 2\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 (+.f64 a (+.f64 b (+.f64 c d))) #s(literal 2 binary64)) < -5.00000000000000041e-6

                    1. Initial program 92.7%

                      \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
                    2. Add Preprocessing
                    3. Taylor expanded in b around inf

                      \[\leadsto \color{blue}{b} \cdot 2 \]
                    4. Step-by-step derivation
                      1. Applied rewrites15.9%

                        \[\leadsto \color{blue}{b} \cdot 2 \]

                      if -5.00000000000000041e-6 < (*.f64 (+.f64 a (+.f64 b (+.f64 c d))) #s(literal 2 binary64))

                      1. Initial program 94.4%

                        \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around inf

                        \[\leadsto \color{blue}{c} \cdot 2 \]
                      4. Step-by-step derivation
                        1. Applied rewrites16.5%

                          \[\leadsto \color{blue}{c} \cdot 2 \]
                      5. Recombined 2 regimes into one program.
                      6. Add Preprocessing

                      Alternative 5: 95.7% accurate, 1.0× speedup?

                      \[\begin{array}{l} \\ 2 \cdot \left(c + \left(\left(d + b\right) + a\right)\right) \end{array} \]
                      (FPCore (a b c d) :precision binary64 (* 2.0 (+ c (+ (+ d b) a))))
                      double code(double a, double b, double c, double d) {
                      	return 2.0 * (c + ((d + b) + a));
                      }
                      
                      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(a, b, c, d)
                      use fmin_fmax_functions
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          real(8), intent (in) :: c
                          real(8), intent (in) :: d
                          code = 2.0d0 * (c + ((d + b) + a))
                      end function
                      
                      public static double code(double a, double b, double c, double d) {
                      	return 2.0 * (c + ((d + b) + a));
                      }
                      
                      def code(a, b, c, d):
                      	return 2.0 * (c + ((d + b) + a))
                      
                      function code(a, b, c, d)
                      	return Float64(2.0 * Float64(c + Float64(Float64(d + b) + a)))
                      end
                      
                      function tmp = code(a, b, c, d)
                      	tmp = 2.0 * (c + ((d + b) + a));
                      end
                      
                      code[a_, b_, c_, d_] := N[(2.0 * N[(c + N[(N[(d + b), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      2 \cdot \left(c + \left(\left(d + b\right) + a\right)\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 93.8%

                        \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around 0

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

                          \[\leadsto \color{blue}{2 \cdot \left(c + \left(\left(d + b\right) + a\right)\right)} \]
                        2. Add Preprocessing

                        Alternative 6: 94.5% accurate, 1.0× speedup?

                        \[\begin{array}{l} \\ 2 \cdot \left(b + \left(\left(d + c\right) + a\right)\right) \end{array} \]
                        (FPCore (a b c d) :precision binary64 (* 2.0 (+ b (+ (+ d c) a))))
                        double code(double a, double b, double c, double d) {
                        	return 2.0 * (b + ((d + c) + a));
                        }
                        
                        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(a, b, c, d)
                        use fmin_fmax_functions
                            real(8), intent (in) :: a
                            real(8), intent (in) :: b
                            real(8), intent (in) :: c
                            real(8), intent (in) :: d
                            code = 2.0d0 * (b + ((d + c) + a))
                        end function
                        
                        public static double code(double a, double b, double c, double d) {
                        	return 2.0 * (b + ((d + c) + a));
                        }
                        
                        def code(a, b, c, d):
                        	return 2.0 * (b + ((d + c) + a))
                        
                        function code(a, b, c, d)
                        	return Float64(2.0 * Float64(b + Float64(Float64(d + c) + a)))
                        end
                        
                        function tmp = code(a, b, c, d)
                        	tmp = 2.0 * (b + ((d + c) + a));
                        end
                        
                        code[a_, b_, c_, d_] := N[(2.0 * N[(b + N[(N[(d + c), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        2 \cdot \left(b + \left(\left(d + c\right) + a\right)\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 93.8%

                          \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
                        2. Add Preprocessing
                        3. Taylor expanded in b around 0

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

                            \[\leadsto \color{blue}{2 \cdot \left(b + \left(\left(d + c\right) + a\right)\right)} \]
                          2. Add Preprocessing

                          Alternative 7: 6.4% accurate, 2.5× speedup?

                          \[\begin{array}{l} \\ b \cdot 2 \end{array} \]
                          (FPCore (a b c d) :precision binary64 (* b 2.0))
                          double code(double a, double b, double c, double d) {
                          	return b * 2.0;
                          }
                          
                          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(a, b, c, d)
                          use fmin_fmax_functions
                              real(8), intent (in) :: a
                              real(8), intent (in) :: b
                              real(8), intent (in) :: c
                              real(8), intent (in) :: d
                              code = b * 2.0d0
                          end function
                          
                          public static double code(double a, double b, double c, double d) {
                          	return b * 2.0;
                          }
                          
                          def code(a, b, c, d):
                          	return b * 2.0
                          
                          function code(a, b, c, d)
                          	return Float64(b * 2.0)
                          end
                          
                          function tmp = code(a, b, c, d)
                          	tmp = b * 2.0;
                          end
                          
                          code[a_, b_, c_, d_] := N[(b * 2.0), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          b \cdot 2
                          \end{array}
                          
                          Derivation
                          1. Initial program 93.8%

                            \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2 \]
                          2. Add Preprocessing
                          3. Taylor expanded in b around inf

                            \[\leadsto \color{blue}{b} \cdot 2 \]
                          4. Step-by-step derivation
                            1. Applied rewrites6.6%

                              \[\leadsto \color{blue}{b} \cdot 2 \]
                            2. Add Preprocessing

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

                            \[\begin{array}{l} \\ \left(a + b\right) \cdot 2 + \left(c + d\right) \cdot 2 \end{array} \]
                            (FPCore (a b c d) :precision binary64 (+ (* (+ a b) 2.0) (* (+ c d) 2.0)))
                            double code(double a, double b, double c, double d) {
                            	return ((a + b) * 2.0) + ((c + d) * 2.0);
                            }
                            
                            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(a, b, c, d)
                            use fmin_fmax_functions
                                real(8), intent (in) :: a
                                real(8), intent (in) :: b
                                real(8), intent (in) :: c
                                real(8), intent (in) :: d
                                code = ((a + b) * 2.0d0) + ((c + d) * 2.0d0)
                            end function
                            
                            public static double code(double a, double b, double c, double d) {
                            	return ((a + b) * 2.0) + ((c + d) * 2.0);
                            }
                            
                            def code(a, b, c, d):
                            	return ((a + b) * 2.0) + ((c + d) * 2.0)
                            
                            function code(a, b, c, d)
                            	return Float64(Float64(Float64(a + b) * 2.0) + Float64(Float64(c + d) * 2.0))
                            end
                            
                            function tmp = code(a, b, c, d)
                            	tmp = ((a + b) * 2.0) + ((c + d) * 2.0);
                            end
                            
                            code[a_, b_, c_, d_] := N[(N[(N[(a + b), $MachinePrecision] * 2.0), $MachinePrecision] + N[(N[(c + d), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \left(a + b\right) \cdot 2 + \left(c + d\right) \cdot 2
                            \end{array}
                            

                            Reproduce

                            ?
                            herbie shell --seed 2025026 
                            (FPCore (a b c d)
                              :name "Expression, p6"
                              :precision binary64
                              :pre (and (and (and (and (<= -14.0 a) (<= a -13.0)) (and (<= -3.0 b) (<= b -2.0))) (and (<= 3.0 c) (<= c 3.5))) (and (<= 12.5 d) (<= d 13.5)))
                            
                              :alt
                              (! :herbie-platform default (let ((e 2)) (+ (* (+ a b) e) (* (+ c d) e))))
                            
                              (* (+ a (+ b (+ c d))) 2.0))