Average Error: 20.5 → 9.7
Time: 9.2s
Precision: binary64
\[\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}\;y \leq -7.523003478271457 \cdot 10^{+37}:\\ \;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{1}{c \cdot \frac{z}{x}}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\right)\\ \mathbf{elif}\;y \leq -5.1063607684978005 \cdot 10^{-132}:\\ \;\;\;\;\frac{1}{\frac{c}{\frac{b + x \cdot \left(y \cdot 9\right)}{z} - 4 \cdot \left(t \cdot a\right)}}\\ \mathbf{elif}\;y \leq -5.711430602583932 \cdot 10^{-156}:\\ \;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(\frac{t}{\sqrt{c}} \cdot \frac{a}{\sqrt{c}}\right)\right)\\ \mathbf{elif}\;y \leq 2.4324523154551576 \cdot 10^{-305}:\\ \;\;\;\;\frac{b + x \cdot \left(y \cdot 9\right)}{z \cdot c} - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;y \leq 19491748.527885776:\\ \;\;\;\;\frac{\left(b + x \cdot \left(y \cdot 9\right)\right) \cdot \frac{1}{z} - 4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(\frac{t}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{a}{\sqrt[3]{c}}\right)\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}\;y \leq -7.523003478271457 \cdot 10^{+37}:\\
\;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{1}{c \cdot \frac{z}{x}}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\right)\\

\mathbf{elif}\;y \leq -5.1063607684978005 \cdot 10^{-132}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b + x \cdot \left(y \cdot 9\right)}{z} - 4 \cdot \left(t \cdot a\right)}}\\

\mathbf{elif}\;y \leq -5.711430602583932 \cdot 10^{-156}:\\
\;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(\frac{t}{\sqrt{c}} \cdot \frac{a}{\sqrt{c}}\right)\right)\\

\mathbf{elif}\;y \leq 2.4324523154551576 \cdot 10^{-305}:\\
\;\;\;\;\frac{b + x \cdot \left(y \cdot 9\right)}{z \cdot c} - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\

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

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

\end{array}
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((double) (((double) (((double) (((double) (x * 9.0)) * y)) - ((double) (((double) (((double) (z * 4.0)) * t)) * a)))) + b)) / ((double) (z * c)));
}
double code(double x, double y, double z, double t, double a, double b, double c) {
	double VAR;
	if ((y <= -7.523003478271457e+37)) {
		VAR = ((double) ((b / ((double) (z * c))) + ((double) (((double) (9.0 * ((double) (y * (1.0 / ((double) (c * (z / x)))))))) - ((double) (4.0 * ((double) (t * (a / c)))))))));
	} else {
		double VAR_1;
		if ((y <= -5.1063607684978005e-132)) {
			VAR_1 = (1.0 / (c / ((double) ((((double) (b + ((double) (x * ((double) (y * 9.0)))))) / z) - ((double) (4.0 * ((double) (t * a))))))));
		} else {
			double VAR_2;
			if ((y <= -5.711430602583932e-156)) {
				VAR_2 = ((double) ((b / ((double) (z * c))) + ((double) (((double) (9.0 * ((double) (y * (x / ((double) (z * c))))))) - ((double) (4.0 * ((double) ((t / ((double) sqrt(c))) * (a / ((double) sqrt(c)))))))))));
			} else {
				double VAR_3;
				if ((y <= 2.4324523154551576e-305)) {
					VAR_3 = ((double) ((((double) (b + ((double) (x * ((double) (y * 9.0)))))) / ((double) (z * c))) - ((double) (4.0 * ((double) (t * (a / c)))))));
				} else {
					double VAR_4;
					if ((y <= 19491748.527885776)) {
						VAR_4 = (((double) (((double) (((double) (b + ((double) (x * ((double) (y * 9.0)))))) * (1.0 / z))) - ((double) (4.0 * ((double) (t * a)))))) / c);
					} else {
						VAR_4 = ((double) ((b / ((double) (z * c))) + ((double) (((double) (9.0 * ((double) (y * (x / ((double) (z * c))))))) - ((double) (4.0 * ((double) ((t / ((double) (((double) cbrt(c)) * ((double) cbrt(c))))) * (a / ((double) cbrt(c)))))))))));
					}
					VAR_3 = VAR_4;
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.5
Target14.7
Herbie9.7
\[\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} < -1.1001567408041051 \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} < -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} < 1.1708877911747488 \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} < 2.876823679546137 \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} < 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 6 regimes
  2. if y < -7.52300347827145674e37

    1. Initial program Error: 26.3 bits

      \[\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. SimplifiedError: 21.5 bits

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

      \[\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. SimplifiedError: 11.9 bits

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

      \[\leadsto \frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \color{blue}{\frac{1}{\frac{z \cdot c}{x}}}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\right)\]
    7. SimplifiedError: 10.2 bits

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

    if -7.52300347827145674e37 < y < -5.1063607684978005e-132

    1. Initial program Error: 16.4 bits

      \[\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. SimplifiedError: 9.6 bits

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

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

    if -5.1063607684978005e-132 < y < -5.71143060258393205e-156

    1. Initial program Error: 18.7 bits

      \[\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. SimplifiedError: 8.4 bits

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

      \[\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. SimplifiedError: 10.2 bits

      \[\leadsto \color{blue}{\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\right)}\]
    5. Using strategy rm
    6. Applied add-sqr-sqrtError: 37.7 bits

      \[\leadsto \frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{\color{blue}{\sqrt{c} \cdot \sqrt{c}}}\right)\right)\]
    7. Applied *-un-lft-identityError: 37.7 bits

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

      \[\leadsto \frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(t \cdot \color{blue}{\left(\frac{1}{\sqrt{c}} \cdot \frac{a}{\sqrt{c}}\right)}\right)\right)\]
    9. Applied associate-*r*Error: 37.0 bits

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

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

    if -5.71143060258393205e-156 < y < 2.4324523154551576e-305

    1. Initial program Error: 16.4 bits

      \[\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. SimplifiedError: 7.4 bits

      \[\leadsto \color{blue}{\frac{\frac{x \cdot \left(9 \cdot y\right) + b}{z} - 4 \cdot \left(t \cdot a\right)}{c}}\]
    3. Using strategy rm
    4. Applied div-subError: 7.4 bits

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

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

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

    if 2.4324523154551576e-305 < y < 19491748.527885776

    1. Initial program Error: 17.2 bits

      \[\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. SimplifiedError: 8.2 bits

      \[\leadsto \color{blue}{\frac{\frac{x \cdot \left(9 \cdot y\right) + b}{z} - 4 \cdot \left(t \cdot a\right)}{c}}\]
    3. Using strategy rm
    4. Applied div-invError: 8.3 bits

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

    if 19491748.527885776 < y

    1. Initial program Error: 24.8 bits

      \[\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. SimplifiedError: 21.5 bits

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

      \[\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. SimplifiedError: 10.2 bits

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

      \[\leadsto \frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{\color{blue}{\left(\sqrt[3]{c} \cdot \sqrt[3]{c}\right) \cdot \sqrt[3]{c}}}\right)\right)\]
    7. Applied *-un-lft-identityError: 10.5 bits

      \[\leadsto \frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{\color{blue}{1 \cdot a}}{\left(\sqrt[3]{c} \cdot \sqrt[3]{c}\right) \cdot \sqrt[3]{c}}\right)\right)\]
    8. Applied times-fracError: 10.5 bits

      \[\leadsto \frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(t \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{a}{\sqrt[3]{c}}\right)}\right)\right)\]
    9. Applied associate-*r*Error: 9.5 bits

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.523003478271457 \cdot 10^{+37}:\\ \;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{1}{c \cdot \frac{z}{x}}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\right)\\ \mathbf{elif}\;y \leq -5.1063607684978005 \cdot 10^{-132}:\\ \;\;\;\;\frac{1}{\frac{c}{\frac{b + x \cdot \left(y \cdot 9\right)}{z} - 4 \cdot \left(t \cdot a\right)}}\\ \mathbf{elif}\;y \leq -5.711430602583932 \cdot 10^{-156}:\\ \;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(\frac{t}{\sqrt{c}} \cdot \frac{a}{\sqrt{c}}\right)\right)\\ \mathbf{elif}\;y \leq 2.4324523154551576 \cdot 10^{-305}:\\ \;\;\;\;\frac{b + x \cdot \left(y \cdot 9\right)}{z \cdot c} - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;y \leq 19491748.527885776:\\ \;\;\;\;\frac{\left(b + x \cdot \left(y \cdot 9\right)\right) \cdot \frac{1}{z} - 4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{z \cdot c} + \left(9 \cdot \left(y \cdot \frac{x}{z \cdot c}\right) - 4 \cdot \left(\frac{t}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{a}{\sqrt[3]{c}}\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020200 
(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.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.1001567408041051e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))

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