Average Error: 6.2 → 1.7
Time: 29.3s
Precision: 64
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
\[\begin{array}{l} \mathbf{if}\;\left(c \cdot b + a\right) \cdot c = -\infty:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;\left(c \cdot b + a\right) \cdot c \le 3.107977172230061026189268024683121316013 \cdot 10^{-220}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right)\\ \end{array}\]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\begin{array}{l}
\mathbf{if}\;\left(c \cdot b + a\right) \cdot c = -\infty:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right)\\

\mathbf{elif}\;\left(c \cdot b + a\right) \cdot c \le 3.107977172230061026189268024683121316013 \cdot 10^{-220}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r36054784 = 2.0;
        double r36054785 = x;
        double r36054786 = y;
        double r36054787 = r36054785 * r36054786;
        double r36054788 = z;
        double r36054789 = t;
        double r36054790 = r36054788 * r36054789;
        double r36054791 = r36054787 + r36054790;
        double r36054792 = a;
        double r36054793 = b;
        double r36054794 = c;
        double r36054795 = r36054793 * r36054794;
        double r36054796 = r36054792 + r36054795;
        double r36054797 = r36054796 * r36054794;
        double r36054798 = i;
        double r36054799 = r36054797 * r36054798;
        double r36054800 = r36054791 - r36054799;
        double r36054801 = r36054784 * r36054800;
        return r36054801;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r36054802 = c;
        double r36054803 = b;
        double r36054804 = r36054802 * r36054803;
        double r36054805 = a;
        double r36054806 = r36054804 + r36054805;
        double r36054807 = r36054806 * r36054802;
        double r36054808 = -inf.0;
        bool r36054809 = r36054807 <= r36054808;
        double r36054810 = 2.0;
        double r36054811 = x;
        double r36054812 = y;
        double r36054813 = r36054811 * r36054812;
        double r36054814 = t;
        double r36054815 = z;
        double r36054816 = r36054814 * r36054815;
        double r36054817 = r36054813 + r36054816;
        double r36054818 = i;
        double r36054819 = r36054802 * r36054818;
        double r36054820 = r36054806 * r36054819;
        double r36054821 = r36054817 - r36054820;
        double r36054822 = r36054810 * r36054821;
        double r36054823 = 3.107977172230061e-220;
        bool r36054824 = r36054807 <= r36054823;
        double r36054825 = r36054818 * r36054807;
        double r36054826 = r36054817 - r36054825;
        double r36054827 = r36054810 * r36054826;
        double r36054828 = r36054824 ? r36054827 : r36054822;
        double r36054829 = r36054809 ? r36054822 : r36054828;
        return r36054829;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.2
Target2.0
Herbie1.7
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\]

Derivation

  1. Split input into 2 regimes
  2. if (* (+ a (* b c)) c) < -inf.0 or 3.107977172230061e-220 < (* (+ a (* b c)) c)

    1. Initial program 13.2

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
    2. Using strategy rm
    3. Applied associate-*l*3.3

      \[\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)\]

    if -inf.0 < (* (+ a (* b c)) c) < 3.107977172230061e-220

    1. Initial program 0.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot b + a\right) \cdot c = -\infty:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;\left(c \cdot b + a\right) \cdot c \le 3.107977172230061026189268024683121316013 \cdot 10^{-220}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + t \cdot z\right) - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right)\\ \end{array}\]

Reproduce

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

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

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