Average Error: 3.6 → 0.5
Time: 4.1s
Precision: 64
\[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b\]
\[\begin{array}{l} \mathbf{if}\;\left(y \cdot 9\right) \cdot z = -\infty:\\ \;\;\;\;\left(2 \cdot x - \left(\left(9 \cdot t\right) \cdot z\right) \cdot y\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\\ \mathbf{elif}\;\left(y \cdot 9\right) \cdot z \le 1.02554425151245149 \cdot 10^{166}:\\ \;\;\;\;\left(2 \cdot x - \left(9 \cdot t\right) \cdot \left(z \cdot y\right)\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array}\]
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z = -\infty:\\
\;\;\;\;\left(2 \cdot x - \left(\left(9 \cdot t\right) \cdot z\right) \cdot y\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\\

\mathbf{elif}\;\left(y \cdot 9\right) \cdot z \le 1.02554425151245149 \cdot 10^{166}:\\
\;\;\;\;\left(2 \cdot x - \left(9 \cdot t\right) \cdot \left(z \cdot y\right)\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r796548 = x;
        double r796549 = 2.0;
        double r796550 = r796548 * r796549;
        double r796551 = y;
        double r796552 = 9.0;
        double r796553 = r796551 * r796552;
        double r796554 = z;
        double r796555 = r796553 * r796554;
        double r796556 = t;
        double r796557 = r796555 * r796556;
        double r796558 = r796550 - r796557;
        double r796559 = a;
        double r796560 = 27.0;
        double r796561 = r796559 * r796560;
        double r796562 = b;
        double r796563 = r796561 * r796562;
        double r796564 = r796558 + r796563;
        return r796564;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r796565 = y;
        double r796566 = 9.0;
        double r796567 = r796565 * r796566;
        double r796568 = z;
        double r796569 = r796567 * r796568;
        double r796570 = -inf.0;
        bool r796571 = r796569 <= r796570;
        double r796572 = 2.0;
        double r796573 = x;
        double r796574 = r796572 * r796573;
        double r796575 = t;
        double r796576 = r796566 * r796575;
        double r796577 = r796576 * r796568;
        double r796578 = r796577 * r796565;
        double r796579 = r796574 - r796578;
        double r796580 = 27.0;
        double r796581 = a;
        double r796582 = b;
        double r796583 = r796581 * r796582;
        double r796584 = r796580 * r796583;
        double r796585 = 1.0;
        double r796586 = pow(r796584, r796585);
        double r796587 = r796579 + r796586;
        double r796588 = 1.0255442515124515e+166;
        bool r796589 = r796569 <= r796588;
        double r796590 = r796568 * r796565;
        double r796591 = r796576 * r796590;
        double r796592 = r796574 - r796591;
        double r796593 = r796592 + r796586;
        double r796594 = r796573 * r796572;
        double r796595 = r796568 * r796575;
        double r796596 = r796567 * r796595;
        double r796597 = r796594 - r796596;
        double r796598 = r796581 * r796580;
        double r796599 = r796598 * r796582;
        double r796600 = r796597 + r796599;
        double r796601 = r796589 ? r796593 : r796600;
        double r796602 = r796571 ? r796587 : r796601;
        return r796602;
}

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

Original3.6
Target2.6
Herbie0.5
\[\begin{array}{l} \mathbf{if}\;y \lt 7.590524218811189 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (* (* y 9.0) z) < -inf.0

    1. Initial program 64.0

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b\]
    2. Using strategy rm
    3. Applied pow164.0

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot \color{blue}{{b}^{1}}\]
    4. Applied pow164.0

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot \color{blue}{{27}^{1}}\right) \cdot {b}^{1}\]
    5. Applied pow164.0

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(\color{blue}{{a}^{1}} \cdot {27}^{1}\right) \cdot {b}^{1}\]
    6. Applied pow-prod-down64.0

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \color{blue}{{\left(a \cdot 27\right)}^{1}} \cdot {b}^{1}\]
    7. Applied pow-prod-down64.0

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \color{blue}{{\left(\left(a \cdot 27\right) \cdot b\right)}^{1}}\]
    8. Simplified64.0

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + {\color{blue}{\left(27 \cdot \left(a \cdot b\right)\right)}}^{1}\]
    9. Taylor expanded around inf 61.8

      \[\leadsto \color{blue}{\left(2 \cdot x - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)} + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\]
    10. Using strategy rm
    11. Applied associate-*r*61.7

      \[\leadsto \left(2 \cdot x - \color{blue}{\left(9 \cdot t\right) \cdot \left(z \cdot y\right)}\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\]
    12. Using strategy rm
    13. Applied associate-*r*0.3

      \[\leadsto \left(2 \cdot x - \color{blue}{\left(\left(9 \cdot t\right) \cdot z\right) \cdot y}\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\]

    if -inf.0 < (* (* y 9.0) z) < 1.0255442515124515e+166

    1. Initial program 0.4

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b\]
    2. Using strategy rm
    3. Applied pow10.4

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot \color{blue}{{b}^{1}}\]
    4. Applied pow10.4

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot \color{blue}{{27}^{1}}\right) \cdot {b}^{1}\]
    5. Applied pow10.4

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(\color{blue}{{a}^{1}} \cdot {27}^{1}\right) \cdot {b}^{1}\]
    6. Applied pow-prod-down0.4

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \color{blue}{{\left(a \cdot 27\right)}^{1}} \cdot {b}^{1}\]
    7. Applied pow-prod-down0.4

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \color{blue}{{\left(\left(a \cdot 27\right) \cdot b\right)}^{1}}\]
    8. Simplified0.4

      \[\leadsto \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + {\color{blue}{\left(27 \cdot \left(a \cdot b\right)\right)}}^{1}\]
    9. Taylor expanded around inf 0.4

      \[\leadsto \color{blue}{\left(2 \cdot x - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)} + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\]
    10. Using strategy rm
    11. Applied associate-*r*0.5

      \[\leadsto \left(2 \cdot x - \color{blue}{\left(9 \cdot t\right) \cdot \left(z \cdot y\right)}\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\]

    if 1.0255442515124515e+166 < (* (* y 9.0) z)

    1. Initial program 20.4

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b\]
    2. Using strategy rm
    3. Applied associate-*l*1.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y \cdot 9\right) \cdot z = -\infty:\\ \;\;\;\;\left(2 \cdot x - \left(\left(9 \cdot t\right) \cdot z\right) \cdot y\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\\ \mathbf{elif}\;\left(y \cdot 9\right) \cdot z \le 1.02554425151245149 \cdot 10^{166}:\\ \;\;\;\;\left(2 \cdot x - \left(9 \cdot t\right) \cdot \left(z \cdot y\right)\right) + {\left(27 \cdot \left(a \cdot b\right)\right)}^{1}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< y 7.590524218811189e-161) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b)))

  (+ (- (* x 2) (* (* (* y 9) z) t)) (* (* a 27) b)))