Average Error: 20.4 → 6.6
Time: 11.5s
Precision: 64
\[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\]
\[\begin{array}{l} \mathbf{if}\;c \le -2.1285760666251394 \cdot 10^{-50} \lor \neg \left(c \le 10.5649412645297911\right) \land c \le 1.7277971702575536 \cdot 10^{274}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{z \cdot \frac{c}{y}}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{c}{\frac{b + \left(x \cdot 9\right) \cdot y}{z} - 4 \cdot \left(t \cdot a\right)}}\\ \end{array}\]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\begin{array}{l}
\mathbf{if}\;c \le -2.1285760666251394 \cdot 10^{-50} \lor \neg \left(c \le 10.5649412645297911\right) \land c \le 1.7277971702575536 \cdot 10^{274}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{z \cdot \frac{c}{y}}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b + \left(x \cdot 9\right) \cdot y}{z} - 4 \cdot \left(t \cdot a\right)}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c) {
        double r427567 = x;
        double r427568 = 9.0;
        double r427569 = r427567 * r427568;
        double r427570 = y;
        double r427571 = r427569 * r427570;
        double r427572 = z;
        double r427573 = 4.0;
        double r427574 = r427572 * r427573;
        double r427575 = t;
        double r427576 = r427574 * r427575;
        double r427577 = a;
        double r427578 = r427576 * r427577;
        double r427579 = r427571 - r427578;
        double r427580 = b;
        double r427581 = r427579 + r427580;
        double r427582 = c;
        double r427583 = r427572 * r427582;
        double r427584 = r427581 / r427583;
        return r427584;
}

double f(double x, double y, double z, double t, double a, double b, double c) {
        double r427585 = c;
        double r427586 = -2.1285760666251394e-50;
        bool r427587 = r427585 <= r427586;
        double r427588 = 10.564941264529791;
        bool r427589 = r427585 <= r427588;
        double r427590 = !r427589;
        double r427591 = 1.7277971702575536e+274;
        bool r427592 = r427585 <= r427591;
        bool r427593 = r427590 && r427592;
        bool r427594 = r427587 || r427593;
        double r427595 = b;
        double r427596 = z;
        double r427597 = r427596 * r427585;
        double r427598 = r427595 / r427597;
        double r427599 = 9.0;
        double r427600 = x;
        double r427601 = y;
        double r427602 = r427585 / r427601;
        double r427603 = r427596 * r427602;
        double r427604 = r427600 / r427603;
        double r427605 = r427599 * r427604;
        double r427606 = r427598 + r427605;
        double r427607 = 4.0;
        double r427608 = a;
        double r427609 = t;
        double r427610 = r427609 / r427585;
        double r427611 = r427608 * r427610;
        double r427612 = r427607 * r427611;
        double r427613 = r427606 - r427612;
        double r427614 = 1.0;
        double r427615 = r427600 * r427599;
        double r427616 = r427615 * r427601;
        double r427617 = r427595 + r427616;
        double r427618 = r427617 / r427596;
        double r427619 = r427609 * r427608;
        double r427620 = r427607 * r427619;
        double r427621 = r427618 - r427620;
        double r427622 = r427585 / r427621;
        double r427623 = r427614 / r427622;
        double r427624 = r427594 ? r427613 : r427623;
        return r427624;
}

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original20.4
Target14.5
Herbie6.6
\[\begin{array}{l} \mathbf{if}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt -1.10015674080410512 \cdot 10^{-171}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt -0.0:\\ \;\;\;\;\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt 1.17088779117474882 \cdot 10^{-53}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt 2.8768236795461372 \cdot 10^{130}:\\ \;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + \frac{b}{c \cdot z}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt 1.3838515042456319 \cdot 10^{158}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + \frac{b}{c \cdot z}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if c < -2.1285760666251394e-50 or 10.564941264529791 < c < 1.7277971702575536e+274

    1. Initial program 22.4

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

      \[\leadsto \color{blue}{\frac{\frac{b + \left(x \cdot 9\right) \cdot y}{z} - 4 \cdot \left(t \cdot a\right)}{c}}\]
    3. Taylor expanded around 0 13.9

      \[\leadsto \color{blue}{\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{a \cdot t}{c}}\]
    4. Using strategy rm
    5. Applied associate-/l*12.3

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \color{blue}{\frac{x}{\frac{z \cdot c}{y}}}\right) - 4 \cdot \frac{a \cdot t}{c}\]
    6. Simplified11.0

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

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

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

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

    if -2.1285760666251394e-50 < c < 10.564941264529791 or 1.7277971702575536e+274 < c

    1. Initial program 16.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \le -2.1285760666251394 \cdot 10^{-50} \lor \neg \left(c \le 10.5649412645297911\right) \land c \le 1.7277971702575536 \cdot 10^{274}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{z \cdot \frac{c}{y}}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{c}{\frac{b + \left(x \cdot 9\right) \cdot y}{z} - 4 \cdot \left(t \cdot a\right)}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020042 
(FPCore (x y z t a b c)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, J"
  :precision binary64

  :herbie-target
  (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -1.1001567408041051e-171) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -0.0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c))))))))

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