Average Error: 3.9 → 1.8
Time: 4.7s
Precision: 64
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;z \cdot 3 \le -3.7755561996985703 \cdot 10^{108} \lor \neg \left(z \cdot 3 \le 46434150027.623123\right):\\ \;\;\;\;\left(\sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}} \cdot \sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}}\right) \cdot \sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\ \end{array}\]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \le -3.7755561996985703 \cdot 10^{108} \lor \neg \left(z \cdot 3 \le 46434150027.623123\right):\\
\;\;\;\;\left(\sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}} \cdot \sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}}\right) \cdot \sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}}\\

\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r983738 = x;
        double r983739 = y;
        double r983740 = z;
        double r983741 = 3.0;
        double r983742 = r983740 * r983741;
        double r983743 = r983739 / r983742;
        double r983744 = r983738 - r983743;
        double r983745 = t;
        double r983746 = r983742 * r983739;
        double r983747 = r983745 / r983746;
        double r983748 = r983744 + r983747;
        return r983748;
}

double f(double x, double y, double z, double t) {
        double r983749 = z;
        double r983750 = 3.0;
        double r983751 = r983749 * r983750;
        double r983752 = -3.7755561996985703e+108;
        bool r983753 = r983751 <= r983752;
        double r983754 = 46434150027.62312;
        bool r983755 = r983751 <= r983754;
        double r983756 = !r983755;
        bool r983757 = r983753 || r983756;
        double r983758 = x;
        double r983759 = y;
        double r983760 = r983759 / r983751;
        double r983761 = r983758 - r983760;
        double r983762 = t;
        double r983763 = r983762 / r983751;
        double r983764 = r983763 / r983759;
        double r983765 = r983761 + r983764;
        double r983766 = cbrt(r983765);
        double r983767 = r983766 * r983766;
        double r983768 = r983767 * r983766;
        double r983769 = 1.0;
        double r983770 = r983769 / r983751;
        double r983771 = r983762 / r983759;
        double r983772 = r983770 * r983771;
        double r983773 = r983761 + r983772;
        double r983774 = r983757 ? r983768 : r983773;
        return r983774;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original3.9
Target1.7
Herbie1.8
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\]

Derivation

  1. Split input into 2 regimes
  2. if (* z 3.0) < -3.7755561996985703e+108 or 46434150027.62312 < (* z 3.0)

    1. Initial program 0.4

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Using strategy rm
    3. Applied associate-/r*1.2

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{\frac{t}{z \cdot 3}}{y}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt2.4

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

    if -3.7755561996985703e+108 < (* z 3.0) < 46434150027.62312

    1. Initial program 8.0

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity8.0

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{\color{blue}{1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\]
    4. Applied times-frac1.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \le -3.7755561996985703 \cdot 10^{108} \lor \neg \left(z \cdot 3 \le 46434150027.623123\right):\\ \;\;\;\;\left(\sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}} \cdot \sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}}\right) \cdot \sqrt[3]{\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y))

  (+ (- x (/ y (* z 3))) (/ t (* (* z 3) y))))