Average Error: 27.1 → 20.9
Time: 21.5s
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}\;a \le -6.147203584124048199955159448919944745691 \cdot 10^{75}:\\ \;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\ \mathbf{elif}\;a \le -6.155686702486672781294624345907714289504 \cdot 10^{-170}:\\ \;\;\;\;\frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a} \cdot \sqrt[3]{\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}} \cdot \frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}}{\sqrt[3]{\left(x + t\right) + y}} - \frac{y}{\left(x + t\right) + y} \cdot b\\ \mathbf{elif}\;a \le 6.340261835080082788347680532822021978218 \cdot 10^{-175}:\\ \;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\ \mathbf{elif}\;a \le 7.121581141661448680701955268111578403189 \cdot 10^{174}:\\ \;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - y \cdot \frac{b}{\left(x + t\right) + y}\\ \mathbf{else}:\\ \;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\ \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}\;a \le -6.147203584124048199955159448919944745691 \cdot 10^{75}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\

\mathbf{elif}\;a \le -6.155686702486672781294624345907714289504 \cdot 10^{-170}:\\
\;\;\;\;\frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a} \cdot \sqrt[3]{\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}} \cdot \frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}}{\sqrt[3]{\left(x + t\right) + y}} - \frac{y}{\left(x + t\right) + y} \cdot b\\

\mathbf{elif}\;a \le 6.340261835080082788347680532822021978218 \cdot 10^{-175}:\\
\;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\

\mathbf{elif}\;a \le 7.121581141661448680701955268111578403189 \cdot 10^{174}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - y \cdot \frac{b}{\left(x + t\right) + y}\\

\mathbf{else}:\\
\;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r555113 = x;
        double r555114 = y;
        double r555115 = r555113 + r555114;
        double r555116 = z;
        double r555117 = r555115 * r555116;
        double r555118 = t;
        double r555119 = r555118 + r555114;
        double r555120 = a;
        double r555121 = r555119 * r555120;
        double r555122 = r555117 + r555121;
        double r555123 = b;
        double r555124 = r555114 * r555123;
        double r555125 = r555122 - r555124;
        double r555126 = r555113 + r555118;
        double r555127 = r555126 + r555114;
        double r555128 = r555125 / r555127;
        return r555128;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r555129 = a;
        double r555130 = -6.147203584124048e+75;
        bool r555131 = r555129 <= r555130;
        double r555132 = y;
        double r555133 = x;
        double r555134 = t;
        double r555135 = r555133 + r555134;
        double r555136 = r555135 + r555132;
        double r555137 = b;
        double r555138 = r555136 / r555137;
        double r555139 = r555132 / r555138;
        double r555140 = r555129 - r555139;
        double r555141 = -6.155686702486673e-170;
        bool r555142 = r555129 <= r555141;
        double r555143 = r555133 + r555132;
        double r555144 = z;
        double r555145 = r555143 * r555144;
        double r555146 = r555134 + r555132;
        double r555147 = r555146 * r555129;
        double r555148 = r555145 + r555147;
        double r555149 = cbrt(r555148);
        double r555150 = r555149 * r555149;
        double r555151 = cbrt(r555136);
        double r555152 = r555151 * r555151;
        double r555153 = r555150 / r555152;
        double r555154 = r555149 / r555151;
        double r555155 = r555153 * r555154;
        double r555156 = r555132 / r555136;
        double r555157 = r555156 * r555137;
        double r555158 = r555155 - r555157;
        double r555159 = 6.340261835080083e-175;
        bool r555160 = r555129 <= r555159;
        double r555161 = r555144 - r555139;
        double r555162 = 7.121581141661449e+174;
        bool r555163 = r555129 <= r555162;
        double r555164 = r555148 / r555136;
        double r555165 = r555137 / r555136;
        double r555166 = r555132 * r555165;
        double r555167 = r555164 - r555166;
        double r555168 = r555163 ? r555167 : r555140;
        double r555169 = r555160 ? r555161 : r555168;
        double r555170 = r555142 ? r555158 : r555169;
        double r555171 = r555131 ? r555140 : r555170;
        return r555171;
}

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.1
Target11.4
Herbie20.9
\[\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.581311708415056427521064305370896655752 \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.228596430831560895857110658734089400289 \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 4 regimes
  2. if a < -6.147203584124048e+75 or 7.121581141661449e+174 < a

    1. Initial program 40.5

      \[\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.5

      \[\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 associate-/l*40.8

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

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

    if -6.147203584124048e+75 < a < -6.155686702486673e-170

    1. Initial program 20.1

      \[\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-sub20.1

      \[\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 associate-/l*16.1

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{\frac{y}{\frac{\left(x + t\right) + y}{b}}}\]
    6. Using strategy rm
    7. Applied associate-/r/15.5

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

      \[\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}{\left(x + t\right) + y} \cdot b\]
    10. Applied add-cube-cbrt16.2

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a} \cdot \sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}\right) \cdot \sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}}}{\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}{\left(x + t\right) + y} \cdot b\]
    11. Applied times-frac16.2

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a} \cdot \sqrt[3]{\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}} \cdot \frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}}{\sqrt[3]{\left(x + t\right) + y}}} - \frac{y}{\left(x + t\right) + y} \cdot b\]

    if -6.155686702486673e-170 < a < 6.340261835080083e-175

    1. Initial program 19.5

      \[\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-sub19.5

      \[\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 associate-/l*16.1

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{\frac{y}{\frac{\left(x + t\right) + y}{b}}}\]
    6. Taylor expanded around inf 19.0

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

    if 6.340261835080083e-175 < a < 7.121581141661449e+174

    1. Initial program 23.9

      \[\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-sub23.9

      \[\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-identity23.9

      \[\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-frac21.2

      \[\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. Simplified21.2

      \[\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}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification20.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -6.147203584124048199955159448919944745691 \cdot 10^{75}:\\ \;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\ \mathbf{elif}\;a \le -6.155686702486672781294624345907714289504 \cdot 10^{-170}:\\ \;\;\;\;\frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a} \cdot \sqrt[3]{\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}} \cdot \frac{\sqrt[3]{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}}{\sqrt[3]{\left(x + t\right) + y}} - \frac{y}{\left(x + t\right) + y} \cdot b\\ \mathbf{elif}\;a \le 6.340261835080082788347680532822021978218 \cdot 10^{-175}:\\ \;\;\;\;z - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\ \mathbf{elif}\;a \le 7.121581141661448680701955268111578403189 \cdot 10^{174}:\\ \;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - y \cdot \frac{b}{\left(x + t\right) + y}\\ \mathbf{else}:\\ \;\;\;\;a - \frac{y}{\frac{\left(x + t\right) + y}{b}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019323 
(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)))