Average Error: 3.7 → 1.0
Time: 19.5s
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 -5.029045341419023773773576307797704521656 \cdot 10^{49}:\\ \;\;\;\;\left(x - \left(\sqrt[3]{\frac{y}{z \cdot 3}} \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\ \mathbf{elif}\;z \cdot 3 \le 1.288291042331374442568053255779255210293 \cdot 10^{76}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \left(\sqrt[3]{\frac{y}{z \cdot 3}} \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) + \frac{\frac{t}{z \cdot 3}}{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 -5.029045341419023773773576307797704521656 \cdot 10^{49}:\\
\;\;\;\;\left(x - \left(\sqrt[3]{\frac{y}{z \cdot 3}} \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\

\mathbf{elif}\;z \cdot 3 \le 1.288291042331374442568053255779255210293 \cdot 10^{76}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r39605524 = x;
        double r39605525 = y;
        double r39605526 = z;
        double r39605527 = 3.0;
        double r39605528 = r39605526 * r39605527;
        double r39605529 = r39605525 / r39605528;
        double r39605530 = r39605524 - r39605529;
        double r39605531 = t;
        double r39605532 = r39605528 * r39605525;
        double r39605533 = r39605531 / r39605532;
        double r39605534 = r39605530 + r39605533;
        return r39605534;
}

double f(double x, double y, double z, double t) {
        double r39605535 = z;
        double r39605536 = 3.0;
        double r39605537 = r39605535 * r39605536;
        double r39605538 = -5.029045341419024e+49;
        bool r39605539 = r39605537 <= r39605538;
        double r39605540 = x;
        double r39605541 = y;
        double r39605542 = r39605541 / r39605537;
        double r39605543 = cbrt(r39605542);
        double r39605544 = r39605543 * r39605543;
        double r39605545 = r39605544 * r39605543;
        double r39605546 = r39605540 - r39605545;
        double r39605547 = t;
        double r39605548 = r39605547 / r39605537;
        double r39605549 = r39605548 / r39605541;
        double r39605550 = r39605546 + r39605549;
        double r39605551 = 1.2882910423313744e+76;
        bool r39605552 = r39605537 <= r39605551;
        double r39605553 = r39605540 - r39605542;
        double r39605554 = 1.0;
        double r39605555 = r39605554 / r39605537;
        double r39605556 = r39605547 / r39605541;
        double r39605557 = r39605555 * r39605556;
        double r39605558 = r39605553 + r39605557;
        double r39605559 = r39605552 ? r39605558 : r39605550;
        double r39605560 = r39605539 ? r39605550 : r39605559;
        return r39605560;
}

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.7
Target1.7
Herbie1.0
\[\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) < -5.029045341419024e+49 or 1.2882910423313744e+76 < (* z 3.0)

    1. Initial program 0.5

      \[\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.1

      \[\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-cbrt1.4

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

    if -5.029045341419024e+49 < (* z 3.0) < 1.2882910423313744e+76

    1. Initial program 7.2

      \[\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-identity7.2

      \[\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-frac0.6

      \[\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.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \le -5.029045341419023773773576307797704521656 \cdot 10^{49}:\\ \;\;\;\;\left(x - \left(\sqrt[3]{\frac{y}{z \cdot 3}} \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\ \mathbf{elif}\;z \cdot 3 \le 1.288291042331374442568053255779255210293 \cdot 10^{76}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \left(\sqrt[3]{\frac{y}{z \cdot 3}} \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) \cdot \sqrt[3]{\frac{y}{z \cdot 3}}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\ \end{array}\]

Reproduce

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

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

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