Average Error: 3.5 → 1.0
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}\;t \le -1.23853620324777987 \cdot 10^{141}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3} \cdot \frac{\frac{1}{y}}{z}\\ \mathbf{elif}\;t \le 8.57969581197539482 \cdot 10^{48}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + 1 \cdot \frac{\frac{t}{z \cdot y}}{3}\\ \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 -1.23853620324777987 \cdot 10^{141}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3} \cdot \frac{\frac{1}{y}}{z}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r805809 = x;
        double r805810 = y;
        double r805811 = z;
        double r805812 = 3.0;
        double r805813 = r805811 * r805812;
        double r805814 = r805810 / r805813;
        double r805815 = r805809 - r805814;
        double r805816 = t;
        double r805817 = r805813 * r805810;
        double r805818 = r805816 / r805817;
        double r805819 = r805815 + r805818;
        return r805819;
}

double f(double x, double y, double z, double t) {
        double r805820 = t;
        double r805821 = -1.2385362032477799e+141;
        bool r805822 = r805820 <= r805821;
        double r805823 = x;
        double r805824 = y;
        double r805825 = z;
        double r805826 = 3.0;
        double r805827 = r805825 * r805826;
        double r805828 = r805824 / r805827;
        double r805829 = r805823 - r805828;
        double r805830 = r805820 / r805826;
        double r805831 = 1.0;
        double r805832 = r805831 / r805824;
        double r805833 = r805832 / r805825;
        double r805834 = r805830 * r805833;
        double r805835 = r805829 + r805834;
        double r805836 = 8.579695811975395e+48;
        bool r805837 = r805820 <= r805836;
        double r805838 = r805820 / r805827;
        double r805839 = r805838 / r805824;
        double r805840 = r805829 + r805839;
        double r805841 = r805824 / r805825;
        double r805842 = r805841 / r805826;
        double r805843 = r805823 - r805842;
        double r805844 = r805825 * r805824;
        double r805845 = r805820 / r805844;
        double r805846 = r805845 / r805826;
        double r805847 = r805831 * r805846;
        double r805848 = r805843 + r805847;
        double r805849 = r805837 ? r805840 : r805848;
        double r805850 = r805822 ? r805835 : r805849;
        return r805850;
}

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.5
Target1.9
Herbie1.0
\[\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 < -1.2385362032477799e+141

    1. Initial program 1.1

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

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

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot \color{blue}{{3}^{1}}\right) \cdot {y}^{1}}\]
    5. Applied pow11.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(\color{blue}{{z}^{1}} \cdot {3}^{1}\right) \cdot {y}^{1}}\]
    6. Applied pow-prod-down1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{{\left(z \cdot 3\right)}^{1}} \cdot {y}^{1}}\]
    7. Applied pow-prod-down1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{{\left(\left(z \cdot 3\right) \cdot y\right)}^{1}}}\]
    8. Simplified1.0

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{{\color{blue}{\left(3 \cdot \left(z \cdot y\right)\right)}}^{1}}\]
    9. Using strategy rm
    10. Applied clear-num1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{1}{\frac{{\left(3 \cdot \left(z \cdot y\right)\right)}^{1}}{t}}}\]
    11. Simplified1.0

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\color{blue}{\frac{3}{\frac{t}{z \cdot y}}}}\]
    12. Using strategy rm
    13. Applied associate-/r/1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\color{blue}{\frac{3}{t} \cdot \left(z \cdot y\right)}}\]
    14. Applied add-cube-cbrt1.1

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

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

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

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

    if -1.2385362032477799e+141 < t < 8.579695811975395e+48

    1. Initial program 4.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-/r*1.0

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

    if 8.579695811975395e+48 < 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 pow10.6

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

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot \color{blue}{{3}^{1}}\right) \cdot {y}^{1}}\]
    5. Applied pow10.6

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(\color{blue}{{z}^{1}} \cdot {3}^{1}\right) \cdot {y}^{1}}\]
    6. Applied pow-prod-down0.6

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{{\left(z \cdot 3\right)}^{1}} \cdot {y}^{1}}\]
    7. Applied pow-prod-down0.6

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

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{{\color{blue}{\left(3 \cdot \left(z \cdot y\right)\right)}}^{1}}\]
    9. Using strategy rm
    10. Applied clear-num0.6

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

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

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

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

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{3}{\frac{t}{z \cdot y}}}}\]
    16. Applied add-cube-cbrt0.8

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020025 +o rules:numerics
(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))))