Average Error: 20.4 → 6.6
Time: 11.7s
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 r837078 = x;
        double r837079 = 9.0;
        double r837080 = r837078 * r837079;
        double r837081 = y;
        double r837082 = r837080 * r837081;
        double r837083 = z;
        double r837084 = 4.0;
        double r837085 = r837083 * r837084;
        double r837086 = t;
        double r837087 = r837085 * r837086;
        double r837088 = a;
        double r837089 = r837087 * r837088;
        double r837090 = r837082 - r837089;
        double r837091 = b;
        double r837092 = r837090 + r837091;
        double r837093 = c;
        double r837094 = r837083 * r837093;
        double r837095 = r837092 / r837094;
        return r837095;
}

double f(double x, double y, double z, double t, double a, double b, double c) {
        double r837096 = c;
        double r837097 = -2.1285760666251394e-50;
        bool r837098 = r837096 <= r837097;
        double r837099 = 10.564941264529791;
        bool r837100 = r837096 <= r837099;
        double r837101 = !r837100;
        double r837102 = 1.7277971702575536e+274;
        bool r837103 = r837096 <= r837102;
        bool r837104 = r837101 && r837103;
        bool r837105 = r837098 || r837104;
        double r837106 = b;
        double r837107 = z;
        double r837108 = r837107 * r837096;
        double r837109 = r837106 / r837108;
        double r837110 = 9.0;
        double r837111 = x;
        double r837112 = y;
        double r837113 = r837096 / r837112;
        double r837114 = r837107 * r837113;
        double r837115 = r837111 / r837114;
        double r837116 = r837110 * r837115;
        double r837117 = r837109 + r837116;
        double r837118 = 4.0;
        double r837119 = a;
        double r837120 = t;
        double r837121 = r837120 / r837096;
        double r837122 = r837119 * r837121;
        double r837123 = r837118 * r837122;
        double r837124 = r837117 - r837123;
        double r837125 = 1.0;
        double r837126 = r837111 * r837110;
        double r837127 = r837126 * r837112;
        double r837128 = r837106 + r837127;
        double r837129 = r837128 / r837107;
        double r837130 = r837120 * r837119;
        double r837131 = r837118 * r837130;
        double r837132 = r837129 - r837131;
        double r837133 = r837096 / r837132;
        double r837134 = r837125 / r837133;
        double r837135 = r837105 ? r837124 : r837134;
        return r837135;
}

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)))