Average Error: 3.9 → 0.4
Time: 6.8s
Precision: 64
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;t \le -3.1361300744902736 \cdot 10^{22}:\\ \;\;\;\;x - \left(\frac{\frac{y}{z}}{3} - t \cdot \frac{\frac{1}{z \cdot 3}}{y}\right)\\ \mathbf{elif}\;t \le 5.46097822804766331 \cdot 10^{49}:\\ \;\;\;\;x - \left(\frac{\frac{y}{z}}{3} - \frac{1}{z} \cdot \frac{\frac{t}{3}}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(3 \cdot y\right)}\\ \end{array}\]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
\mathbf{if}\;t \le -3.1361300744902736 \cdot 10^{22}:\\
\;\;\;\;x - \left(\frac{\frac{y}{z}}{3} - t \cdot \frac{\frac{1}{z \cdot 3}}{y}\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r862820 = x;
        double r862821 = y;
        double r862822 = z;
        double r862823 = 3.0;
        double r862824 = r862822 * r862823;
        double r862825 = r862821 / r862824;
        double r862826 = r862820 - r862825;
        double r862827 = t;
        double r862828 = r862824 * r862821;
        double r862829 = r862827 / r862828;
        double r862830 = r862826 + r862829;
        return r862830;
}

double f(double x, double y, double z, double t) {
        double r862831 = t;
        double r862832 = -3.1361300744902736e+22;
        bool r862833 = r862831 <= r862832;
        double r862834 = x;
        double r862835 = y;
        double r862836 = z;
        double r862837 = r862835 / r862836;
        double r862838 = 3.0;
        double r862839 = r862837 / r862838;
        double r862840 = 1.0;
        double r862841 = r862836 * r862838;
        double r862842 = r862840 / r862841;
        double r862843 = r862842 / r862835;
        double r862844 = r862831 * r862843;
        double r862845 = r862839 - r862844;
        double r862846 = r862834 - r862845;
        double r862847 = 5.460978228047663e+49;
        bool r862848 = r862831 <= r862847;
        double r862849 = r862840 / r862836;
        double r862850 = r862831 / r862838;
        double r862851 = r862850 / r862835;
        double r862852 = r862849 * r862851;
        double r862853 = r862839 - r862852;
        double r862854 = r862834 - r862853;
        double r862855 = r862835 / r862841;
        double r862856 = r862834 - r862855;
        double r862857 = r862838 * r862835;
        double r862858 = r862836 * r862857;
        double r862859 = r862831 / r862858;
        double r862860 = r862856 + r862859;
        double r862861 = r862848 ? r862854 : r862860;
        double r862862 = r862833 ? r862846 : r862861;
        return r862862;
}

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
Herbie0.4
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -3.1361300744902736e+22

    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*2.7

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{\frac{t}{z \cdot 3}}{y}}\]
    4. Using strategy rm
    5. Applied associate-/r*2.7

      \[\leadsto \left(x - \color{blue}{\frac{\frac{y}{z}}{3}}\right) + \frac{\frac{t}{z \cdot 3}}{y}\]
    6. Using strategy rm
    7. Applied associate-+l-2.7

      \[\leadsto \color{blue}{x - \left(\frac{\frac{y}{z}}{3} - \frac{\frac{t}{z \cdot 3}}{y}\right)}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity2.7

      \[\leadsto x - \left(\frac{\frac{y}{z}}{3} - \frac{\frac{t}{z \cdot 3}}{\color{blue}{1 \cdot y}}\right)\]
    10. Applied div-inv2.8

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

      \[\leadsto x - \left(\frac{\frac{y}{z}}{3} - \color{blue}{\frac{t}{1} \cdot \frac{\frac{1}{z \cdot 3}}{y}}\right)\]
    12. Simplified0.4

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

    if -3.1361300744902736e+22 < t < 5.460978228047663e+49

    1. Initial program 5.8

      \[\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 associate-/r*1.1

      \[\leadsto \left(x - \color{blue}{\frac{\frac{y}{z}}{3}}\right) + \frac{\frac{t}{z \cdot 3}}{y}\]
    6. Using strategy rm
    7. Applied associate-+l-1.1

      \[\leadsto \color{blue}{x - \left(\frac{\frac{y}{z}}{3} - \frac{\frac{t}{z \cdot 3}}{y}\right)}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity1.1

      \[\leadsto x - \left(\frac{\frac{y}{z}}{3} - \frac{\frac{t}{z \cdot 3}}{\color{blue}{1 \cdot y}}\right)\]
    10. Applied *-un-lft-identity1.1

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

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

      \[\leadsto x - \left(\frac{\frac{y}{z}}{3} - \color{blue}{\frac{\frac{1}{z}}{1} \cdot \frac{\frac{t}{3}}{y}}\right)\]
    13. Simplified0.3

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

    if 5.460978228047663e+49 < t

    1. Initial program 0.6

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

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

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

Reproduce

herbie shell --seed 2020047 
(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))))