Average Error: 27.0 → 14.1
Time: 5.6s
Precision: 64
\[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
\[\begin{array}{l} \mathbf{if}\;y \le -9.09241517201754519 \cdot 10^{57} \lor \neg \left(y \le 871276637713058560\right):\\ \;\;\;\;\left(a + z\right) - y \cdot \frac{b}{\left(x + t\right) + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}}}{\sqrt[3]{\left(x + t\right) + y}} - \frac{y \cdot b}{\left(x + t\right) + y}\\ \end{array}\]
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\begin{array}{l}
\mathbf{if}\;y \le -9.09241517201754519 \cdot 10^{57} \lor \neg \left(y \le 871276637713058560\right):\\
\;\;\;\;\left(a + z\right) - y \cdot \frac{b}{\left(x + t\right) + y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}}}{\sqrt[3]{\left(x + t\right) + y}} - \frac{y \cdot b}{\left(x + t\right) + y}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r1080810 = x;
        double r1080811 = y;
        double r1080812 = r1080810 + r1080811;
        double r1080813 = z;
        double r1080814 = r1080812 * r1080813;
        double r1080815 = t;
        double r1080816 = r1080815 + r1080811;
        double r1080817 = a;
        double r1080818 = r1080816 * r1080817;
        double r1080819 = r1080814 + r1080818;
        double r1080820 = b;
        double r1080821 = r1080811 * r1080820;
        double r1080822 = r1080819 - r1080821;
        double r1080823 = r1080810 + r1080815;
        double r1080824 = r1080823 + r1080811;
        double r1080825 = r1080822 / r1080824;
        return r1080825;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r1080826 = y;
        double r1080827 = -9.092415172017545e+57;
        bool r1080828 = r1080826 <= r1080827;
        double r1080829 = 8.712766377130586e+17;
        bool r1080830 = r1080826 <= r1080829;
        double r1080831 = !r1080830;
        bool r1080832 = r1080828 || r1080831;
        double r1080833 = a;
        double r1080834 = z;
        double r1080835 = r1080833 + r1080834;
        double r1080836 = b;
        double r1080837 = x;
        double r1080838 = t;
        double r1080839 = r1080837 + r1080838;
        double r1080840 = r1080839 + r1080826;
        double r1080841 = r1080836 / r1080840;
        double r1080842 = r1080826 * r1080841;
        double r1080843 = r1080835 - r1080842;
        double r1080844 = r1080837 + r1080826;
        double r1080845 = r1080844 * r1080834;
        double r1080846 = r1080838 + r1080826;
        double r1080847 = r1080846 * r1080833;
        double r1080848 = r1080845 + r1080847;
        double r1080849 = cbrt(r1080840);
        double r1080850 = r1080849 * r1080849;
        double r1080851 = r1080848 / r1080850;
        double r1080852 = r1080851 / r1080849;
        double r1080853 = r1080826 * r1080836;
        double r1080854 = r1080853 / r1080840;
        double r1080855 = r1080852 - r1080854;
        double r1080856 = r1080832 ? r1080843 : r1080855;
        return r1080856;
}

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original27.0
Target11.1
Herbie14.1
\[\begin{array}{l} \mathbf{if}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \lt -3.5813117084150564 \cdot 10^{153}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \lt 1.2285964308315609 \cdot 10^{82}:\\ \;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -9.092415172017545e+57 or 8.712766377130586e+17 < y

    1. Initial program 40.8

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Using strategy rm
    3. Applied div-sub40.8

      \[\leadsto \color{blue}{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\left(x + t\right) + y}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity40.8

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\color{blue}{1 \cdot \left(\left(x + t\right) + y\right)}}\]
    6. Applied times-frac34.3

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{\frac{y}{1} \cdot \frac{b}{\left(x + t\right) + y}}\]
    7. Simplified34.3

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y} \cdot \frac{b}{\left(x + t\right) + y}\]
    8. Using strategy rm
    9. Applied clear-num34.4

      \[\leadsto \color{blue}{\frac{1}{\frac{\left(x + t\right) + y}{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}}} - y \cdot \frac{b}{\left(x + t\right) + y}\]
    10. Taylor expanded around 0 10.6

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

    if -9.092415172017545e+57 < y < 8.712766377130586e+17

    1. Initial program 16.2

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Using strategy rm
    3. Applied div-sub16.2

      \[\leadsto \color{blue}{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\left(x + t\right) + y}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt16.9

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\color{blue}{\left(\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}\right) \cdot \sqrt[3]{\left(x + t\right) + y}}} - \frac{y \cdot b}{\left(x + t\right) + y}\]
    6. Applied associate-/r*16.9

      \[\leadsto \color{blue}{\frac{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}}}{\sqrt[3]{\left(x + t\right) + y}}} - \frac{y \cdot b}{\left(x + t\right) + y}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification14.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -9.09241517201754519 \cdot 10^{57} \lor \neg \left(y \le 871276637713058560\right):\\ \;\;\;\;\left(a + z\right) - y \cdot \frac{b}{\left(x + t\right) + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}}}{\sqrt[3]{\left(x + t\right) + y}} - \frac{y \cdot b}{\left(x + t\right) + y}\\ \end{array}\]

Reproduce

herbie shell --seed 2020056 
(FPCore (x y z t a b)
  :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
  :precision binary64

  :herbie-target
  (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))

  (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))