Average Error: 27.0 → 14.6
Time: 36.0s
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 -2.203596059264075389810488806677819676938 \cdot 10^{-76}:\\ \;\;\;\;\left(\sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b} \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\right) \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\\ \mathbf{elif}\;y \le 8.638006545329684926182962993454851729979 \cdot 10^{75}:\\ \;\;\;\;\frac{1}{\frac{\left(y + t\right) + x}{a \cdot \left(y + t\right) + \left(y + x\right) \cdot z}} - \frac{y \cdot b}{\left(y + t\right) + x}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b} \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\right) \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot 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}\;y \le -2.203596059264075389810488806677819676938 \cdot 10^{-76}:\\
\;\;\;\;\left(\sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b} \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\right) \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r39691186 = x;
        double r39691187 = y;
        double r39691188 = r39691186 + r39691187;
        double r39691189 = z;
        double r39691190 = r39691188 * r39691189;
        double r39691191 = t;
        double r39691192 = r39691191 + r39691187;
        double r39691193 = a;
        double r39691194 = r39691192 * r39691193;
        double r39691195 = r39691190 + r39691194;
        double r39691196 = b;
        double r39691197 = r39691187 * r39691196;
        double r39691198 = r39691195 - r39691197;
        double r39691199 = r39691186 + r39691191;
        double r39691200 = r39691199 + r39691187;
        double r39691201 = r39691198 / r39691200;
        return r39691201;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r39691202 = y;
        double r39691203 = -2.2035960592640754e-76;
        bool r39691204 = r39691202 <= r39691203;
        double r39691205 = a;
        double r39691206 = z;
        double r39691207 = r39691205 + r39691206;
        double r39691208 = t;
        double r39691209 = r39691202 + r39691208;
        double r39691210 = x;
        double r39691211 = r39691209 + r39691210;
        double r39691212 = r39691202 / r39691211;
        double r39691213 = b;
        double r39691214 = r39691212 * r39691213;
        double r39691215 = r39691207 - r39691214;
        double r39691216 = cbrt(r39691215);
        double r39691217 = r39691216 * r39691216;
        double r39691218 = r39691217 * r39691216;
        double r39691219 = 8.638006545329685e+75;
        bool r39691220 = r39691202 <= r39691219;
        double r39691221 = 1.0;
        double r39691222 = r39691205 * r39691209;
        double r39691223 = r39691202 + r39691210;
        double r39691224 = r39691223 * r39691206;
        double r39691225 = r39691222 + r39691224;
        double r39691226 = r39691211 / r39691225;
        double r39691227 = r39691221 / r39691226;
        double r39691228 = r39691202 * r39691213;
        double r39691229 = r39691228 / r39691211;
        double r39691230 = r39691227 - r39691229;
        double r39691231 = r39691220 ? r39691230 : r39691218;
        double r39691232 = r39691204 ? r39691218 : r39691231;
        return r39691232;
}

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.2
Herbie14.6
\[\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 2 regimes
  2. if y < -2.2035960592640754e-76 or 8.638006545329685e+75 < y

    1. Initial program 37.4

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Simplified37.4

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

      \[\leadsto \frac{\color{blue}{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - b \cdot y}}{x + \left(y + t\right)}\]
    5. Applied div-sub37.4

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

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

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

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

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

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

    if -2.2035960592640754e-76 < y < 8.638006545329685e+75

    1. Initial program 16.4

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Simplified16.4

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

      \[\leadsto \frac{\color{blue}{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - b \cdot y}}{x + \left(y + t\right)}\]
    5. Applied div-sub16.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.203596059264075389810488806677819676938 \cdot 10^{-76}:\\ \;\;\;\;\left(\sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b} \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\right) \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\\ \mathbf{elif}\;y \le 8.638006545329684926182962993454851729979 \cdot 10^{75}:\\ \;\;\;\;\frac{1}{\frac{\left(y + t\right) + x}{a \cdot \left(y + t\right) + \left(y + x\right) \cdot z}} - \frac{y \cdot b}{\left(y + t\right) + x}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b} \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\right) \cdot \sqrt[3]{\left(a + z\right) - \frac{y}{\left(y + t\right) + x} \cdot b}\\ \end{array}\]

Reproduce

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

  :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.0 (/ (+ (+ 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)))